
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>图色函数 · EasyClick开发文档</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-chapter-fold/chapter-fold.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-code/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-search-pro/search.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-anchor-navigation-ex/style/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="device-api.html" />
    
    
    <link rel="prev" href="event-api.html" />
    

    
        <link rel="shortcut icon" href="/zh-cn/images/ico.png" type="image/x-icon">
    
    
    
    
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="/zh-cn/images/ico.png">
    
    
        
    
    
        
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../../">
            
                <a href="../../">
            
                    
                    简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../features.html">
            
                <a href="../features.html">
            
                    
                    特性
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../changelog.html">
            
                <a href="../changelog.html">
            
                    
                    更改记录
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../getting-start.html">
            
                <a href="../getting-start.html">
            
                    
                    开始
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5" >
            
                <a target="_blank" href="https://www.bilibili.com/video/bv1W54y1Q7JG">
            
                    
                    视频教程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="devtools/dev-tools.html">
            
                <a href="devtools/dev-tools.html">
            
                    
                    开发工具介绍
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="devtools/dev-tools-install.html">
            
                <a href="devtools/dev-tools-install.html">
            
                    
                    安装
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="devtools/dev-tools-project.html">
            
                <a href="devtools/dev-tools-project.html">
            
                    
                    工程相关
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="devtools/dev-tools-device.html">
            
                <a href="devtools/dev-tools-device.html">
            
                    
                    设备相关
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="devtools/dev-tools-screen.html">
            
                <a href="devtools/dev-tools-screen.html">
            
                    
                    屏幕相关
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.5" data-path="devtools/dev-tools-settings.html">
            
                <a href="devtools/dev-tools-settings.html">
            
                    
                    设置
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../funcs.html">
            
                <a href="../funcs.html">
            
                    
                    功能函数
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="global/global.html">
            
                <a href="global/global.html">
            
                    
                    全局模块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="global/global-shortcut.html">
            
                <a href="global/global-shortcut.html">
            
                    
                    全局快捷事件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="global/selector-node.html">
            
                <a href="global/selector-node.html">
            
                    
                    选择器&节点
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.4" data-path="acevent-api.html">
            
                <a href="acevent-api.html">
            
                    
                    无障碍事件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.5" data-path="event-api.html">
            
                <a href="event-api.html">
            
                    
                    代理事件
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.7.6" data-path="image-api.html">
            
                <a href="image-api.html">
            
                    
                    图色函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.7" data-path="device-api.html">
            
                <a href="device-api.html">
            
                    
                    设备函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.8" data-path="file-api.html">
            
                <a href="file-api.html">
            
                    
                    文件函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.9" data-path="http-api.html">
            
                <a href="http-api.html">
            
                    
                    网络函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.10" data-path="thread-api.html">
            
                <a href="thread-api.html">
            
                    
                    线程函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.11" data-path="utils-api.html">
            
                <a href="utils-api.html">
            
                    
                    常用工具函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.12" data-path="shell-api.html">
            
                <a href="shell-api.html">
            
                    
                    Shell命令函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.13" data-path="sqlite-api.html">
            
                <a href="sqlite-api.html">
            
                    
                    Sqlite命令函数
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="ui-custom.html">
            
                <a href="ui-custom.html">
            
                    
                    原生UI定制
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="ui-js-inter.html">
            
                <a href="ui-js-inter.html">
            
                    
                    JS编写UI
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="ui-js-template.html">
            
                <a href="ui-js-template.html">
            
                    
                    模板式UI
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3" data-path="ui-native-view.html">
            
                <a href="ui-native-view.html">
            
                    
                    原生UI控件
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.3.1" data-path="ui/linearlayout.html">
            
                <a href="ui/linearlayout.html">
            
                    
                    LinearLayout线性布局
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3.2" data-path="ui/framelayout.html">
            
                <a href="ui/framelayout.html">
            
                    
                    FrameLayout帧布局
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3.3" data-path="ui/relativelayout.html">
            
                <a href="ui/relativelayout.html">
            
                    
                    RelativeLayout绝对布局
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3.4" data-path="ui/scrollview.html">
            
                <a href="ui/scrollview.html">
            
                    
                    ScrollView滚动框
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3.5" data-path="ui/view.html">
            
                <a href="ui/view.html">
            
                    
                    View视图
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3.6" data-path="ui/button.html">
            
                <a href="ui/button.html">
            
                    
                    Button按钮
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3.7" data-path="ui/textview.html">
            
                <a href="ui/textview.html">
            
                    
                    TextView文本
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3.8" data-path="ui/edittext.html">
            
                <a href="ui/edittext.html">
            
                    
                    EditText输入框
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3.9" data-path="ui/checkbox.html">
            
                <a href="ui/checkbox.html">
            
                    
                    CheckBox复选框
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3.10" data-path="ui/radiogroup.html">
            
                <a href="ui/radiogroup.html">
            
                    
                    RadioGroup布局
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3.11" data-path="ui/radiobutton.html">
            
                <a href="ui/radiobutton.html">
            
                    
                    RadioButton单选框
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3.12" data-path="ui/spinner.html">
            
                <a href="ui/spinner.html">
            
                    
                    Spinner下拉选择框
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3.13" data-path="ui/webview.html">
            
                <a href="ui/webview.html">
            
                    
                    WebView内嵌浏览器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3.14" data-path="ui/imageview.html">
            
                <a href="ui/imageview.html">
            
                    
                    ImageView图像
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3.15" data-path="ui/cardview.html">
            
                <a href="ui/cardview.html">
            
                    
                    CardView卡片布局
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3.16" data-path="ui/switch.html">
            
                <a href="ui/switch.html">
            
                    
                    Swtich开关按钮
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="html-ui-custom.html">
            
                <a href="html-ui-custom.html">
            
                    
                    H5 UI定制
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="../hot-update.html">
            
                <a href="../hot-update.html">
            
                    
                    热更新功能
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="../zk/zk.html">
            
                <a href="../zk/zk.html">
            
                    
                    企业版中控接口
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.11.1" data-path="../zk/zk-ec-state.html">
            
                <a href="../zk/zk-ec-state.html">
            
                    
                    EC状态控制接口
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.2" data-path="../zk/zk-node.html">
            
                <a href="../zk/zk-node.html">
            
                    
                    全局节点模块接口
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.11.2.1" data-path="../zk/global/zk-global-log.html">
            
                <a href="../zk/global/zk-global-log.html">
            
                    
                    日志接口
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.2.2" data-path="../zk/global/zk-node-service.html">
            
                <a href="../zk/global/zk-node-service.html">
            
                    
                    节点服务接口
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.2.3" data-path="../zk/global/zk-global-click.html">
            
                <a href="../zk/global/zk-global-click.html">
            
                    
                    点击动作接口
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.2.4" data-path="../zk/global/zk-global-multitouch.html">
            
                <a href="../zk/global/zk-global-multitouch.html">
            
                    
                    多点触摸动作接口
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.2.5" data-path="../zk/global/zk-global-swipe.html">
            
                <a href="../zk/global/zk-global-swipe.html">
            
                    
                    滑动动作接口
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.2.6" data-path="../zk/global/zk-global-drag.html">
            
                <a href="../zk/global/zk-global-drag.html">
            
                    
                    拖动动作接口
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.2.7" data-path="../zk/global/zk-global-input.html">
            
                <a href="../zk/global/zk-global-input.html">
            
                    
                    输入动作接口
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.2.8" data-path="../zk/global/zk-global-node.html">
            
                <a href="../zk/global/zk-global-node.html">
            
                    
                    节点操作接口
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.2.9" data-path="../zk/global/zk-global-systemkey.html">
            
                <a href="../zk/global/zk-global-systemkey.html">
            
                    
                    系统按键接口
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.2.10" data-path="../zk/global/zk-global-notice.html">
            
                <a href="../zk/global/zk-global-notice.html">
            
                    
                    通知栏接口
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.2.11" data-path="../zk/global/zk-global-floatview.html">
            
                <a href="../zk/global/zk-global-floatview.html">
            
                    
                    悬浮窗接口
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.11.3" data-path="../zk/zk-agent.html">
            
                <a href="../zk/zk-agent.html">
            
                    
                    代理事件模块接口 - 开发中
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.4" data-path="../zk/zk-image.html">
            
                <a href="../zk/zk-image.html">
            
                    
                    图色模块接口 - 开发中
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.5" data-path="../zk/zk-device.md">
            
                <span>
            
                    
                    设备模块接口 - 开发中
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.6" data-path="../zk/zk-file.md">
            
                <span>
            
                    
                    文件模块接口 - 开发中
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.7" data-path="../zk/zk-http.md">
            
                <span>
            
                    
                    网络模块接口 - 开发中
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.8" data-path="../zk/zk-utils.md">
            
                <span>
            
                    
                    常用工具模块接口 - 开发中
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.9" data-path="../zk/zk-shell.md">
            
                <span>
            
                    
                    Shell命令模块接口 - 开发中
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.10" data-path="../zk/zk-sqlite.md">
            
                <span>
            
                    
                    Sqlite模块接口 - 开发中
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.12" data-path="plugin/plugins.html">
            
                <a href="plugin/plugins.html">
            
                    
                    插件开发
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13" data-path="../question-answer.html">
            
                <a href="../question-answer.html">
            
                    
                    常见问题
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14" data-path="../agreement.html">
            
                <a href="../agreement.html">
            
                    
                    用户协议
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15" data-path="../declare.html">
            
                <a href="../declare.html">
            
                    
                    免责声明
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.16" >
            
                <span>
            
                    
                    技术交流 QQ群：777164022
            
                </span>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../.." >图色函数</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <div id="anchor-navigation-ex-navbar"><i class="fa fa-navicon"></i><ul><li><span class="title-icon "></span><a href="#&#x8BF4;&#x660E;"><b>1. </b>&#x8BF4;&#x660E;</a></li><li><span class="title-icon "></span><a href="#&#x7533;&#x8BF7;&#x622A;&#x56FE;"><b>2. </b>&#x7533;&#x8BF7;&#x622A;&#x56FE;</a></li><ul><li><span class="title-icon "></span><a href="#imagerequestscreencapture"><b>2.1. </b>image.requestScreenCapture</a></li><li><span class="title-icon "></span><a href="#imagereleasescreencapture"><b>2.2. </b>image.releaseScreenCapture</a></li></ul><li><span class="title-icon "></span><a href="#&#x622A;&#x56FE;"><b>3. </b>&#x622A;&#x56FE;</a></li><ul><li><span class="title-icon "></span><a href="#imagecapturescreen"><b>3.1. </b>image.captureScreen</a></li><li><span class="title-icon "></span><a href="#imagecapturefullscreen"><b>3.2. </b>image.captureFullScreen</a></li><li><span class="title-icon "></span><a href="#imagecapturescreenbitmap"><b>3.3. </b>image.captureScreenBitmap</a></li><li><span class="title-icon "></span><a href="#imagecapturetofile"><b>3.4. </b>image.captureToFile</a></li></ul><li><span class="title-icon "></span><a href="#&#x627E;&#x8272;"><b>4. </b>&#x627E;&#x8272;</a></li><ul><li><span class="title-icon "></span><a href="#imagefindcolor"><b>4.1. </b>image.findColor</a></li><li><span class="title-icon "></span><a href="#imagefindcolorj"><b>4.2. </b>image.findColorJ</a></li><li><span class="title-icon "></span><a href="#imagefindcolorex"><b>4.3. </b>image.findColorEx</a></li><li><span class="title-icon "></span><a href="#imagefindcolorexj"><b>4.4. </b>image.findColorExJ</a></li><li><span class="title-icon "></span><a href="#imagefindmulticolor"><b>4.5. </b>image.findMultiColor</a></li><li><span class="title-icon "></span><a href="#imagefindmulticolorj"><b>4.6. </b>image.findMultiColorJ</a></li><li><span class="title-icon "></span><a href="#imagefindmulticolorex"><b>4.7. </b>image.findMultiColorEx</a></li><li><span class="title-icon "></span><a href="#imagefindmulticolorexj"><b>4.8. </b>image.findMultiColorExJ</a></li></ul><li><span class="title-icon "></span><a href="#&#x627E;&#x56FE;"><b>5. </b>&#x627E;&#x56FE;</a></li><ul><li><span class="title-icon "></span><a href="#imagefindimage"><b>5.1. </b>image.findImage</a></li><li><span class="title-icon "></span><a href="#imagefindimageex"><b>5.2. </b>image.findImageEx</a></li><li><span class="title-icon "></span><a href="#imagematchtemplate-&#x6A21;&#x677F;&#x5339;&#x914D;"><b>5.3. </b>image.matchTemplate &#x6A21;&#x677F;&#x5339;&#x914D;</a></li><li><span class="title-icon "></span><a href="#imagematchtemplateex-&#x6A21;&#x677F;&#x5339;&#x914D;"><b>5.4. </b>image.matchTemplateEx &#x6A21;&#x677F;&#x5339;&#x914D;</a></li></ul><li><span class="title-icon "></span><a href="#&#x5176;&#x4ED6;"><b>6. </b>&#x5176;&#x4ED6;</a></li><ul><li><span class="title-icon "></span><a href="#imagereadimage"><b>6.1. </b>image.readImage</a></li><li><span class="title-icon "></span><a href="#imagereadbitmap"><b>6.2. </b>image.readBitmap</a></li><li><span class="title-icon "></span><a href="#imagepixelinimage"><b>6.3. </b>image.pixelInImage</a></li><li><span class="title-icon "></span><a href="#imagegetpixelbitmap"><b>6.4. </b>image.getPixelBitmap</a></li><li><span class="title-icon "></span><a href="#imagegetpixelsbitmap"><b>6.5. </b>image.getPixelsBitmap</a></li></ul><li><span class="title-icon "></span><a href="#&#x56FE;&#x7247;&#x8F6C;&#x6362;"><b>7. </b>&#x56FE;&#x7247;&#x8F6C;&#x6362;</a></li><ul><li><span class="title-icon "></span><a href="#imagesaveto"><b>7.1. </b>image.saveTo</a></li><li><span class="title-icon "></span><a href="#imagetobase64"><b>7.2. </b>image.toBase64</a></li><li><span class="title-icon "></span><a href="#imageclip"><b>7.3. </b>image.clip</a></li><li><span class="title-icon "></span><a href="#imagepixel"><b>7.4. </b>image.pixel</a></li><li><span class="title-icon "></span><a href="#imageisrecycled"><b>7.5. </b>image.isRecycled</a></li><li><span class="title-icon "></span><a href="#imagerecycle"><b>7.6. </b>image.recycle</a></li></ul></ul></div><a href="#&#x8BF4;&#x660E;" id="anchorNavigationExGoTop"><i class="fa fa-arrow-up"></i></a><h1 id="&#x8BF4;&#x660E;"><a name="&#x8BF4;&#x660E;" class="anchor-navigation-ex-anchor" href="#&#x8BF4;&#x660E;"><i class="fa fa-link" aria-hidden="true"></i></a>1. &#x8BF4;&#x660E;</h1>
<ul>
<li>&#x622A;&#x56FE;&#x51FD;&#x6570;&#x9700;&#x8981;Andrioid 5.0 &#x4EE5;&#x4E0A;&#x7248;&#x672C;&#x624D;&#x80FD;&#x4F7F;&#x7528;</li>
<li>&#x65E0;&#x969C;&#x788D;&#x6A21;&#x5F0F;&#x4E0B;&#x622A;&#x56FE;&#x662F;&#x9700;&#x8981;&#x6743;&#x9650;&#x7684;&#xFF0C;&#x5982;&#x679C;&#x5F39;&#x51FA;&#x4E86;&#x8FD0;&#x884C;&#x622A;&#x56FE;&#xFF0C;&#x8BF7;&#x6388;&#x6743;</li>
<li>&#x4EE3;&#x7406;&#x6A21;&#x5F0F;&#x4E0B;&#x7684;&#x622A;&#x56FE;&#x4E0D;&#x9700;&#x8981;&#x6743;&#x9650;&#xFF0C;&#x5EFA;&#x8BAE;&#x957F;&#x671F;&#x8FD0;&#x884C;&#x4F7F;&#x7528;&#x4EE3;&#x7406;&#x6A21;&#x5F0F;</li>
<li>&#x56FE;&#x8272;&#x6A21;&#x5757;&#x7684;&#x5BF9;&#x8C61;&#x524D;&#x7F00;&#x662F;image&#xFF0C;&#x4F8B;&#x5982; image.requestScreenCapture()&#x8FD9;&#x6837;&#x8C03;&#x7528;</li>
<li>&#x56FE;&#x8272;&#x6A21;&#x5757;&#x9700;&#x8981;&#x5BF9;&#x989C;&#x8272;&#x8FDB;&#x884C;&#x67E5;&#x627E;&#xFF0C;&#x5F00;&#x53D1;&#x5DE5;&#x5177;&#x81EA;&#x5E26;&#x627E;&#x8272;&#x529F;&#x80FD;&#xFF0C;&#x8BF7;&#x53C2;&#x8003;<a href="devtools/dev-tools-screen.html#&#x627E;&#x8272;&#x64CD;&#x4F5C;">&#x627E;&#x8272;&#x627E;&#x56FE;&#x64CD;&#x4F5C;</a></li>
</ul>
<h1 id="&#x7533;&#x8BF7;&#x622A;&#x56FE;"><a name="&#x7533;&#x8BF7;&#x622A;&#x56FE;" class="anchor-navigation-ex-anchor" href="#&#x7533;&#x8BF7;&#x622A;&#x56FE;"><i class="fa fa-link" aria-hidden="true"></i></a>2. &#x7533;&#x8BF7;&#x622A;&#x56FE;</h1>
<h2 id="imagerequestscreencapture"><a name="imagerequestscreencapture" class="anchor-navigation-ex-anchor" href="#imagerequestscreencapture"><i class="fa fa-link" aria-hidden="true"></i></a>2.1. image.requestScreenCapture</h2>
<ul>
<li>&#x5411;&#x7CFB;&#x7EDF;&#x7533;&#x8BF7;&#x5C4F;&#x5E55;&#x622A;&#x56FE;&#x6743;&#x9650;&#xFF0C;&#x8FD4;&#x56DE;&#x662F;&#x5426;&#x8BF7;&#x6C42;&#x6210;&#x529F;&#x3002;</li>
<li>&#x7B2C;&#x4E00;&#x6B21;&#x4F7F;&#x7528;&#x8BE5;&#x51FD;&#x6570;&#x4F1A;&#x5F39;&#x51FA;&#x622A;&#x56FE;&#x6743;&#x9650;&#x8BF7;&#x6C42;&#xFF0C;&#x5EFA;&#x8BAE;&#x9009;&#x62E9;&#x201C;&#x603B;&#x662F;&#x5141;&#x8BB8;&#x201D;&#x3002;</li>
<li>&#x8FD9;&#x4E2A;&#x51FD;&#x6570;&#x53EA;&#x662F;&#x7533;&#x8BF7;&#x622A;&#x56FE;&#x6743;&#x9650;&#xFF0C;&#x5E76;&#x4E0D;&#x4F1A;&#x771F;&#x6B63;&#x6267;&#x884C;&#x622A;&#x56FE;&#xFF0C;&#x771F;&#x6B63;&#x7684;&#x622A;&#x56FE;&#x51FD;&#x6570;&#x662F;captureScreen()&#x3002;</li>
<li>&#x8BE5;&#x51FD;&#x6570;&#x5728;&#x622A;&#x56FE;&#x811A;&#x672C;&#x4E2D;&#x53EA;&#x9700;&#x6267;&#x884C;&#x4E00;&#x6B21;&#xFF0C;&#x800C;&#x65E0;&#x9700;&#x6BCF;&#x6B21;&#x8C03;&#x7528;captureScreen()&#x90FD;&#x8C03;&#x7528;&#x4E00;&#x6B21;&#x3002;<ul>
<li>@param timeout &#x8D85;&#x65F6;&#x65F6;&#x95F4;&#xFF0C;&#x5355;&#x4F4D;&#x662F;&#x6BEB;&#x79D2;</li>
<li>@param type &#x622A;&#x5C4F;&#x7684;&#x7C7B;&#x578B;&#xFF0C;0 &#x81EA;&#x52A8;&#x9009;&#x62E9;&#xFF0C;1 &#x4EE3;&#x8868;&#x6388;&#x6743;&#x6A21;&#x5F0F;&#xFF0C;2 &#x4EE3;&#x8868;&#x65E0;&#x9700;&#x6743;&#x9650;&#x6A21;&#x5F0F;&#xFF08;&#x8BE5;&#x6A21;&#x5F0F;&#x524D;&#x63D0;&#x6761;&#x4EF6;&#xFF1A;&#x8FD0;&#x884C;&#x6A21;&#x5F0F;&#x4E3A;&#x4EE3;&#x7406;&#x6A21;&#x5F0F;&#xFF09;</li>
</ul>
</li>
<li>@return true &#x4EE3;&#x8868;&#x6210;&#x529F; false&#x4EE3;&#x8868;&#x5931;&#x8D25;</li>
</ul>
<blockquote>
<pre><code class="lang-javascript">
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">main</span>(<span class="hljs-params"></span>) </span>{
    <span class="hljs-keyword">var</span> request = image.requestScreenCapture(<span class="hljs-number">10000</span>,<span class="hljs-number">0</span>);
    <span class="hljs-keyword">if</span> (request){
        toast(<span class="hljs-string">&quot;&#x7533;&#x8BF7;&#x6210;&#x529F;&quot;</span>);
    }<span class="hljs-keyword">else</span> {
        toast(<span class="hljs-string">&quot;&#x7533;&#x8BF7;&#x5931;&#x8D25;&quot;</span>);
    }
}
main();
</code></pre>
</blockquote>
<h2 id="imagereleasescreencapture"><a name="imagereleasescreencapture" class="anchor-navigation-ex-anchor" href="#imagereleasescreencapture"><i class="fa fa-link" aria-hidden="true"></i></a>2.2. image.releaseScreenCapture</h2>
<ul>
<li>&#x91CA;&#x653E;&#x622A;&#x5C4F;&#x8BF7;&#x6C42;</li>
</ul>
<blockquote>
<pre><code class="lang-javascript">
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">main</span>(<span class="hljs-params"></span>) </span>{
    image.releaseScreenCapture();
}
main();
</code></pre>
</blockquote>
<h1 id="&#x622A;&#x56FE;"><a name="&#x622A;&#x56FE;" class="anchor-navigation-ex-anchor" href="#&#x622A;&#x56FE;"><i class="fa fa-link" aria-hidden="true"></i></a>3. &#x622A;&#x56FE;</h1>
<h2 id="imagecapturescreen"><a name="imagecapturescreen" class="anchor-navigation-ex-anchor" href="#imagecapturescreen"><i class="fa fa-link" aria-hidden="true"></i></a>3.1. image.captureScreen</h2>
<ul>
<li>&#x622A;&#x53D6;&#x5F53;&#x524D;&#x5C4F;&#x5E55;&#x5E76;&#x8FD4;&#x56DE;&#x4E00;&#x4E2A;Image&#x5BF9;&#x8C61;&#x3002;</li>
<li>&#x6CA1;&#x6709;&#x622A;&#x56FE;&#x6743;&#x9650;&#x65F6;&#x6267;&#x884C;&#x8BE5;&#x51FD;&#x6570;&#x4F1A;&#x8FD4;&#x56DE;null</li>
<li>&#x4E24;&#x6B21;&#x8C03;&#x7528;&#x53EF;&#x80FD;&#x8FD4;&#x56DE;&#x76F8;&#x540C;&#x7684;Image&#x5BF9;&#x8C61;&#x3002;&#x8FD9;&#x662F;&#x56E0;&#x4E3A;&#x8BBE;&#x5907;&#x622A;&#x56FE;&#x7684;&#x66F4;&#x65B0;&#x9700;&#x8981;&#x4E00;&#x5B9A;&#x7684;&#x65F6;&#x95F4;&#xFF0C;&#x77ED;&#x65F6;&#x95F4;&#x5185;&#xFF08;&#x4E00;&#x822C;&#x6765;&#x8BF4;&#x662F;16ms&#xFF09;&#x8FDE;&#x7EED;&#x8C03;&#x7528;&#x5219;&#x4F1A;&#x8FD4;&#x56DE;&#x540C;&#x4E00;&#x5F20;&#x622A;&#x56FE;&#x3002;</li>
<li>&#x622A;&#x56FE;&#x9700;&#x8981;&#x8F6C;&#x6362;&#x4E3A;Bitmap&#x683C;&#x5F0F;&#xFF0C;&#x4ECE;&#x800C;&#x8BE5;&#x51FD;&#x6570;&#x6267;&#x884C;&#x9700;&#x8981;&#x4E00;&#x5B9A;&#x7684;&#x65F6;&#x95F4;(0~20ms)&#x3002;</li>
<li>&#x53E6;&#x5916;&#x5728;requestScreenCapture()&#x6267;&#x884C;&#x6210;&#x529F;&#x540E;&#x9700;&#x8981;&#x4E00;&#x5B9A;&#x65F6;&#x95F4;&#x540E;&#x624D;&#x6709;&#x622A;&#x56FE;&#x53EF;&#x7528;&#xFF0C;&#x56E0;&#x6B64;&#x5982;&#x679C;&#x7ACB;&#x5373;&#x8C03;&#x7528;captureScreen()&#xFF0C;&#x4F1A;&#x7B49;&#x5F85;&#x4E00;&#x5B9A;&#x65F6;&#x95F4;&#x540E;(&#x4E00;&#x822C;&#x4E3A;&#x51E0;&#x767E;ms)&#x624D;&#x8FD4;&#x56DE;&#x622A;&#x56FE;&#x3002;</li>
<li>&#x5982;&#x679C;&#x533A;&#x57DF;&#x7A7A;&#x6216;&#x5219;&#x6709;&#x8D1F;&#x6570;&#x7684;&#xFF0C;&#x5C31;&#x4F1A;&#x662F;&#x5168;&#x5C4F;</li>
<li>@param retryNumber &#x91CD;&#x8BD5;&#x6B21;&#x6570;&#xFF0C;&#x76F4;&#x5230;&#x80FD;&#x622A;&#x5230;&#x56FE;&#x4E3A;&#x6B62;&#xFF0C;&#x9ED8;&#x8BA4;&#x662F;3</li>
<li>@param x &#x622A;&#x56FE;&#x7684;&#x8D77;&#x59CB;X&#x5750;&#x6807;</li>
<li>@param y &#x622A;&#x56FE;&#x7684;&#x8D77;&#x59CB;Y&#x5750;&#x6807;</li>
<li>@param w &#x622A;&#x56FE;&#x7684;&#x5BBD;&#x5EA6;&#xFF0C;&#x4ECE;X&#x5750;&#x6807;&#x7B97;&#x8D77;</li>
<li>@param h &#x622A;&#x56FE;&#x7684;&#x9AD8;&#x5EA6;&#xFF0C;&#x4ECE;Y&#x5750;&#x6807;&#x7B97;&#x8D77;</li>
<li>@return AutoImage&#x5BF9;&#x8C61;&#x6216;&#x8005;null</li>
</ul>
<blockquote>
<pre><code class="lang-javascript">
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">main</span>(<span class="hljs-params"></span>) </span>{
    <span class="hljs-keyword">var</span> image = image.captureScreen(<span class="hljs-number">3</span>,<span class="hljs-number">0</span>,<span class="hljs-number">0</span>,<span class="hljs-number">300</span>,<span class="hljs-number">400</span>);
    <span class="hljs-keyword">if</span> (image!=<span class="hljs-literal">null</span>){
        toast(<span class="hljs-string">&quot;&#x622A;&#x56FE;&#x6210;&#x529F;&quot;</span>);
    } <span class="hljs-keyword">else</span> {
        toast(<span class="hljs-string">&quot;&#x622A;&#x56FE;&#x5931;&#x8D25;&quot;</span>);
    }
}
main();
</code></pre>
</blockquote>
<h2 id="imagecapturefullscreen"><a name="imagecapturefullscreen" class="anchor-navigation-ex-anchor" href="#imagecapturefullscreen"><i class="fa fa-link" aria-hidden="true"></i></a>3.2. image.captureFullScreen</h2>
<ul>
<li>&#x622A;&#x53D6;&#x5F53;&#x524D;&#x5C4F;&#x5E55;&#x5E76;&#x8FD4;&#x56DE;&#x4E00;&#x4E2A;Image&#x5BF9;&#x8C61;&#x3002;</li>
<li>@return AutoImage&#x5BF9;&#x8C61;&#x6216;&#x8005;null</li>
</ul>
<blockquote>
<pre><code class="lang-javascript">
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">main</span>(<span class="hljs-params"></span>) </span>{
    <span class="hljs-keyword">var</span> image = image.captureFullScreen();
    <span class="hljs-keyword">if</span> (image!=<span class="hljs-literal">null</span>){
        toast(<span class="hljs-string">&quot;&#x622A;&#x56FE;&#x6210;&#x529F;&quot;</span>);
    } <span class="hljs-keyword">else</span> {
        toast(<span class="hljs-string">&quot;&#x622A;&#x56FE;&#x5931;&#x8D25;&quot;</span>);
    }
}
main();
</code></pre>
</blockquote>
<h2 id="imagecapturescreenbitmap"><a name="imagecapturescreenbitmap" class="anchor-navigation-ex-anchor" href="#imagecapturescreenbitmap"><i class="fa fa-link" aria-hidden="true"></i></a>3.3. image.captureScreenBitmap</h2>
<ul>
<li>&#x5C06;&#x5C4F;&#x5E55;&#x6293;&#x53D6;&#x4E3A;Bitmap&#x5BF9;&#x8C61;&#xFF0C;&#x5982;&#x679C;&#x4E2D;&#x95F4;&#x6709;-1&#x6216;&#x8005;&#x5BBD;&#x5EA6;&#x3001;&#x5BBD;&#x5EA6;&#x4E3A;-1&#xFF0C;&#x5C06;&#x4F1A;&#x662F;&#x5168;&#x5C4F;</li>
<li>@param format jpg&#x6216;&#x8005;png&#xFF0C;&#x4EE3;&#x7406;&#x6A21;&#x5F0F;&#x4E0B;&#x6709;&#x7528;</li>
<li>@param x &#x5F00;&#x59CB;X&#x5750;&#x6807;</li>
<li>@param y &#x5F00;&#x59CB;Y&#x5750;&#x6807;</li>
<li>@param w &#x5BBD;&#x5EA6;</li>
<li>@param h &#x9AD8;&#x5EA6;</li>
<li>@param q &#x56FE;&#x7247;&#x8D28;&#x91CF;&#xFF0C;1 - 100&#xFF0C;&#x8D8A;&#x9AD8;&#x8D8A;&#x597D;&#xFF0C;&#x4EE3;&#x7406;&#x6A21;&#x5F0F;&#x4E0B;&#x6709;&#x7528;</li>
<li>@return Bitmap null&#x6216;&#x8005;bitmap&#x5BF9;&#x8C61;</li>
</ul>
<blockquote>
<pre><code class="lang-javascript">
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">main</span>(<span class="hljs-params"></span>) </span>{
    <span class="hljs-keyword">var</span> b = image.captureScreenBitmap(<span class="hljs-string">&quot;jpg&quot;</span>,<span class="hljs-number">800</span>,<span class="hljs-number">800</span>,<span class="hljs-number">100</span>,<span class="hljs-number">100</span>,<span class="hljs-number">100</span>);
    <span class="hljs-keyword">if</span> (b!=<span class="hljs-literal">null</span>){
        toast(<span class="hljs-string">&quot;&#x622A;&#x56FE;&#x6210;&#x529F;&quot;</span>);
    } <span class="hljs-keyword">else</span> {
        toast(<span class="hljs-string">&quot;&#x622A;&#x56FE;&#x5931;&#x8D25;&quot;</span>);
    }
}
main();
</code></pre>
</blockquote>
<h2 id="imagecapturetofile"><a name="imagecapturetofile" class="anchor-navigation-ex-anchor" href="#imagecapturetofile"><i class="fa fa-link" aria-hidden="true"></i></a>3.4. image.captureToFile</h2>
<ul>
<li>&#x622A;&#x53D6;&#x5F53;&#x524D;&#x5C4F;&#x5E55;&#x5E76;&#x4EE5;PNG&#x683C;&#x5F0F;&#x4FDD;&#x5B58;&#x5230;path&#x4E2D;&#x3002;&#x5982;&#x679C;&#x6587;&#x4EF6;&#x4E0D;&#x5B58;&#x5728;&#x4F1A;&#x88AB;&#x521B;&#x5EFA;&#xFF1B;&#x6587;&#x4EF6;&#x5B58;&#x5728;&#x4F1A;&#x88AB;&#x8986;&#x76D6;&#x3002;</li>
<li>&#x5982;&#x679C;&#x533A;&#x57DF;&#x7A7A;&#x6216;&#x5219;&#x6709;&#x8D1F;&#x6570;&#x7684;&#xFF0C;&#x5C31;&#x4F1A;&#x662F;&#x5168;&#x5C4F;</li>
<li>@param retryNumber &#x91CD;&#x8BD5;&#x6B21;&#x6570;&#xFF0C;&#x76F4;&#x5230;&#x80FD;&#x622A;&#x5230;&#x56FE;&#x4E3A;&#x6B62;&#xFF0C;&#x9ED8;&#x8BA4;&#x662F;3</li>
<li>@param x &#x622A;&#x56FE;&#x7684;&#x8D77;&#x59CB;X&#x5750;&#x6807;</li>
<li>@param y &#x622A;&#x56FE;&#x7684;&#x8D77;&#x59CB;Y&#x5750;&#x6807;</li>
<li>@param w &#x622A;&#x56FE;&#x7684;&#x5BBD;&#x5EA6;&#xFF0C;&#x4ECE;X&#x5750;&#x6807;&#x7B97;&#x8D77;</li>
<li>@param h &#x622A;&#x56FE;&#x7684;&#x9AD8;&#x5EA6;&#xFF0C;&#x4ECE;Y&#x5750;&#x6807;&#x7B97;&#x8D77;</li>
<li>@param path &#x622A;&#x56FE;&#x4FDD;&#x5B58;&#x8DEF;&#x5F84;</li>
<li>@return true &#x622A;&#x56FE;&#x6210;&#x529F; false &#x4EE3;&#x8868;&#x4E0D;&#x6210;&#x529F;</li>
</ul>
<blockquote>
<pre><code class="lang-javascript">
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">main</span>(<span class="hljs-params"></span>) </span>{
    <span class="hljs-keyword">var</span> cap = image.captureToFile(<span class="hljs-number">3</span>,<span class="hljs-number">0</span>,<span class="hljs-number">0</span>,<span class="hljs-number">300</span>,<span class="hljs-number">400</span>,<span class="hljs-string">&quot;/sdcard/a.png&quot;</span>);
    <span class="hljs-keyword">if</span> (cap){
        toast(<span class="hljs-string">&quot;&#x622A;&#x56FE;&#x6210;&#x529F;&quot;</span>);
    }<span class="hljs-keyword">else</span> {
        toast(<span class="hljs-string">&quot;&#x622A;&#x56FE;&#x5931;&#x8D25;&quot;</span>);
    }
}
main();
</code></pre>
</blockquote>
<h1 id="&#x627E;&#x8272;"><a name="&#x627E;&#x8272;" class="anchor-navigation-ex-anchor" href="#&#x627E;&#x8272;"><i class="fa fa-link" aria-hidden="true"></i></a>4. &#x627E;&#x8272;</h1>
<h2 id="imagefindcolor"><a name="imagefindcolor" class="anchor-navigation-ex-anchor" href="#imagefindcolor"><i class="fa fa-link" aria-hidden="true"></i></a>4.1. image.findColor</h2>
<ul>
<li>&#x5728;&#x56FE;&#x7247;&#x4E2D;&#x627E;&#x5230;&#x989C;&#x8272;&#x548C;color&#x5B8C;&#x5168;&#x76F8;&#x7B49;&#x7684;&#x67D0;&#x4E2A;&#x70B9;&#xFF0C;&#x5E76;&#x8FD4;&#x56DE;&#x8BE5;&#x70B9;&#x7684;&#x5DE6;&#x8FB9;&#xFF1B;&#x5982;&#x679C;&#x6CA1;&#x6709;&#x627E;&#x5230;&#xFF0C;&#x5219;&#x8FD4;&#x56DE;null&#x3002;</li>
<li>@param image &#x56FE;&#x7247;</li>
<li>@param color     &#x8981;&#x5BFB;&#x627E;&#x7684;&#x989C;&#x8272;</li>
<li>@param threshold &#x627E;&#x8272;&#x65F6;&#x989C;&#x8272;&#x76F8;&#x4F3C;&#x5EA6;&#x53D6;&#x503C;&#x4E3A; 0.0 ~ 1.0</li>
<li>@param x &#x533A;&#x57DF;&#x7684;X&#x8D77;&#x59CB;&#x5750;&#x6807;</li>
<li>@param y &#x533A;&#x57DF;&#x7684;Y&#x8D77;&#x59CB;&#x5750;&#x6807;</li>
<li>@param w &#x533A;&#x57DF;&#x7684;&#x5BBD;&#x5EA6;</li>
<li>@param h &#x533A;&#x57DF;&#x7684;&#x9AD8;&#x5EA6;</li>
<li>@param limit &#x9650;&#x5236;&#x4E2A;&#x6570;</li>
<li>@return &#x591A;&#x4E2A;Point &#x5750;&#x6807;&#x70B9;&#x6570;&#x7EC4;&#x6216;&#x8005;null</li>
</ul>
<blockquote>
<pre><code class="lang-javascript">
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">main</span>(<span class="hljs-params"></span>) </span>{
      <span class="hljs-keyword">var</span> req = image.requestScreenCapture(<span class="hljs-number">10000</span>,<span class="hljs-number">0</span>);
        <span class="hljs-keyword">if</span> (!req) {
         req = image.requestScreenCapture(<span class="hljs-number">10000</span>,<span class="hljs-number">0</span>);
      }
      <span class="hljs-keyword">if</span> (!req) {
          toast(<span class="hljs-string">&quot;&#x7533;&#x8BF7;&#x6743;&#x9650;&#x5931;&#x8D25;&quot;</span>);
          <span class="hljs-keyword">return</span>;
      }
      <span class="hljs-keyword">var</span> aimage = image.captureFullScreen();
      <span class="hljs-keyword">if</span> (aimage != <span class="hljs-literal">null</span>) {
          <span class="hljs-keyword">var</span> points = image.findColor(aimage,<span class="hljs-string">&quot;0xCDD7E9-0x101010&quot;</span>, <span class="hljs-number">0.9</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">10</span>);
          logd(<span class="hljs-string">&quot;points &quot;</span>+points);
      }

}
main();
</code></pre>
</blockquote>
<h2 id="imagefindcolorj"><a name="imagefindcolorj" class="anchor-navigation-ex-anchor" href="#imagefindcolorj"><i class="fa fa-link" aria-hidden="true"></i></a>4.2. image.findColorJ</h2>
<ul>
<li>&#x5728;&#x56FE;&#x7247;&#x4E2D;&#x627E;&#x5230;&#x989C;&#x8272;&#x548C;color&#x5B8C;&#x5168;&#x76F8;&#x7B49;&#x7684;&#x70B9;&#xFF0C;&#x53C2;&#x6570;&#x4ECE;JSON&#x4E2D;&#x83B7;&#x53D6;&#x5982;&#x679C;&#x6CA1;&#x6709;&#x627E;&#x5230;&#xFF0C;&#x5219;&#x8FD4;&#x56DE;null&#x3002;</li>
<li>@param image &#x56FE;&#x7247;</li>
<li>@param jsonFileName     res&#x6587;&#x4EF6;&#x4E2D;&#x53D6;&#x8272;&#x5DE5;&#x5177;&#x751F;&#x6210;&#x7684;JSON&#x6587;&#x4EF6;&#xFF0C;&#x53EA;&#x8981;&#x586B;&#x5199;&#x6587;&#x4EF6;&#x540D;&#x79F0;&#x5373;&#x53EF;&#xFF0C;&#x540E;&#x7F00;&#x4E0D;&#x7528;&#x586B;&#x5199;</li>
<li>@return &#x591A;&#x4E2A;Point &#x5750;&#x6807;&#x70B9;&#x6570;&#x7EC4;&#x6216;&#x8005;null</li>
</ul>
<blockquote>
<pre><code class="lang-javascript">
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">main</span>(<span class="hljs-params"></span>) </span>{
      <span class="hljs-keyword">var</span> req = image.requestScreenCapture(<span class="hljs-number">10000</span>,<span class="hljs-number">0</span>);
        <span class="hljs-keyword">if</span> (!req) {
         req = image.requestScreenCapture(<span class="hljs-number">10000</span>,<span class="hljs-number">0</span>);
      }
      <span class="hljs-keyword">if</span> (!req) {
          toast(<span class="hljs-string">&quot;&#x7533;&#x8BF7;&#x6743;&#x9650;&#x5931;&#x8D25;&quot;</span>);
          <span class="hljs-keyword">return</span>;
      }
      <span class="hljs-keyword">var</span> aimage = image.captureFullScreen();
      <span class="hljs-keyword">if</span> (aimage != <span class="hljs-literal">null</span>) {
          <span class="hljs-keyword">var</span> points = image.findColorJ(aimage,<span class="hljs-string">&quot;&#x91D1;&#x5E01;&quot;</span>);
          logd(<span class="hljs-string">&quot;points &quot;</span>+points);
      }

}
main();
</code></pre>
</blockquote>
<h2 id="imagefindcolorex"><a name="imagefindcolorex" class="anchor-navigation-ex-anchor" href="#imagefindcolorex"><i class="fa fa-link" aria-hidden="true"></i></a>4.3. image.findColorEx</h2>
<ul>
<li>&#x5728;&#x5F53;&#x524D;&#x5C4F;&#x5E55;&#x4E2D;&#x627E;&#x5230;&#x989C;&#x8272;&#x548C;color&#x5B8C;&#x5168;&#x76F8;&#x7B49;&#x7684;&#x70B9;&#xFF0C;&#x5E76;&#x8FD4;&#x56DE;&#x8BE5;&#x70B9;&#x7684;&#x5DE6;&#x8FB9;&#xFF1B;&#x5982;&#x679C;&#x6CA1;&#x6709;&#x627E;&#x5230;&#xFF0C;&#x5219;&#x8FD4;&#x56DE;null&#x3002;</li>
<li>@param color     &#x8981;&#x5BFB;&#x627E;&#x7684;&#x989C;&#x8272;</li>
<li>@param threshold &#x627E;&#x8272;&#x65F6;&#x989C;&#x8272;&#x76F8;&#x4F3C;&#x5EA6;&#x53D6;&#x503C;&#x4E3A; 0.0 ~ 1.0</li>
<li>@param x &#x533A;&#x57DF;&#x7684;X&#x8D77;&#x59CB;&#x5750;&#x6807;</li>
<li>@param y &#x533A;&#x57DF;&#x7684;Y&#x8D77;&#x59CB;&#x5750;&#x6807;</li>
<li>@param w &#x533A;&#x57DF;&#x7684;&#x5BBD;&#x5EA6;</li>
<li>@param h &#x533A;&#x57DF;&#x7684;&#x9AD8;&#x5EA6;</li>
<li>@param limit &#x9650;&#x5236;&#x4E2A;&#x6570;</li>
<li>@return &#x591A;&#x4E2A;Point &#x5750;&#x6807;&#x70B9;&#x6570;&#x7EC4;&#x6216;&#x8005;null</li>
</ul>
<blockquote>
<pre><code class="lang-javascript">
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">main</span>(<span class="hljs-params"></span>) </span>{
      <span class="hljs-keyword">var</span> req = image.requestScreenCapture(<span class="hljs-number">10000</span>,<span class="hljs-number">0</span>);
        <span class="hljs-keyword">if</span> (!req) {
         req = image.requestScreenCapture(<span class="hljs-number">10000</span>,<span class="hljs-number">0</span>);
      }
      <span class="hljs-keyword">if</span> (!req) {
          toast(<span class="hljs-string">&quot;&#x7533;&#x8BF7;&#x6743;&#x9650;&#x5931;&#x8D25;&quot;</span>);
          <span class="hljs-keyword">return</span>;
      }
      <span class="hljs-keyword">var</span> points = image.findColorEx(<span class="hljs-string">&quot;0xCDD7E9-0x101010&quot;</span>, <span class="hljs-number">0.9</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">10</span>);
      logd(<span class="hljs-string">&quot;points &quot;</span>+points);

}
main();
</code></pre>
</blockquote>
<h2 id="imagefindcolorexj"><a name="imagefindcolorexj" class="anchor-navigation-ex-anchor" href="#imagefindcolorexj"><i class="fa fa-link" aria-hidden="true"></i></a>4.4. image.findColorExJ</h2>
<ul>
<li>&#x5F53;&#x524D;&#x5C4F;&#x5E55;&#x4E2D;&#x627E;&#x5230;&#x989C;&#x8272;&#x548C;color&#x5B8C;&#x5168;&#x76F8;&#x7B49;&#x7684;&#x70B9;&#xFF0C;&#x53C2;&#x6570;&#x4ECE;JSON&#x4E2D;&#x83B7;&#x53D6;&#x5982;&#x679C;&#x6CA1;&#x6709;&#x627E;&#x5230;&#xFF0C;&#x5219;&#x8FD4;&#x56DE;null&#x3002;</li>
<li>@param jsonFileName     res&#x6587;&#x4EF6;&#x4E2D;&#x53D6;&#x8272;&#x5DE5;&#x5177;&#x751F;&#x6210;&#x7684;JSON&#x6587;&#x4EF6;&#xFF0C;&#x53EA;&#x8981;&#x586B;&#x5199;&#x6587;&#x4EF6;&#x540D;&#x79F0;&#x5373;&#x53EF;&#xFF0C;&#x540E;&#x7F00;&#x4E0D;&#x7528;&#x586B;&#x5199;</li>
<li>@return &#x591A;&#x4E2A;Point &#x5750;&#x6807;&#x70B9;&#x6570;&#x7EC4;&#x6216;&#x8005;null</li>
</ul>
<blockquote>
<pre><code class="lang-javascript">
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">main</span>(<span class="hljs-params"></span>) </span>{
      <span class="hljs-keyword">var</span> req = image.requestScreenCapture(<span class="hljs-number">10000</span>,<span class="hljs-number">0</span>);
        <span class="hljs-keyword">if</span> (!req) {
         req = image.requestScreenCapture(<span class="hljs-number">10000</span>,<span class="hljs-number">0</span>);
      }
      <span class="hljs-keyword">if</span> (!req) {
          toast(<span class="hljs-string">&quot;&#x7533;&#x8BF7;&#x6743;&#x9650;&#x5931;&#x8D25;&quot;</span>);
          <span class="hljs-keyword">return</span>;
      }
      <span class="hljs-keyword">var</span> points = image.findColorExJ(<span class="hljs-string">&quot;&#x91D1;&#x5E01;&quot;</span>);
      logd(<span class="hljs-string">&quot;points &quot;</span>+points);

}
main();
</code></pre>
</blockquote>
<h2 id="imagefindmulticolor"><a name="imagefindmulticolor" class="anchor-navigation-ex-anchor" href="#imagefindmulticolor"><i class="fa fa-link" aria-hidden="true"></i></a>4.5. image.findMultiColor</h2>
<ul>
<li>&#x591A;&#x70B9;&#x627E;&#x8272;&#xFF0C;&#x627E;&#x5230;&#x6240;&#x6709;&#x7B26;&#x5408;&#x6807;&#x51C6;&#x7684;&#x70B9;&#xFF0C;&#x7C7B;&#x4F3C;&#x4E8E;&#x6309;&#x952E;&#x7CBE;&#x7075;&#x7684;&#x591A;&#x70B9;&#x627E;&#x8272;&#x3002;</li>
<li>@param image      &#x8981;&#x627E;&#x8272;&#x7684;&#x56FE;&#x7247;</li>
<li>@param firstColor &#x7B2C;&#x4E00;&#x4E2A;&#x70B9;&#x7684;&#x989C;&#x8272;</li>
<li>@param threshold &#x627E;&#x8272;&#x65F6;&#x989C;&#x8272;&#x76F8;&#x4F3C;&#x5EA6;&#x53D6;&#x503C;&#x4E3A; 0.0 ~ 1.0</li>
<li>@param points     &#x5B57;&#x7B26;&#x4E32;&#x7C7B;&#x4F3C;&#x8FD9;&#x6837; 6|1|0x969696-0x000010,1|12|0x969696,-4|0|0x969696</li>
<li>@param x &#x533A;&#x57DF;&#x7684;X&#x8D77;&#x59CB;&#x5750;&#x6807;</li>
<li>@param y &#x533A;&#x57DF;&#x7684;Y&#x8D77;&#x59CB;&#x5750;&#x6807;</li>
<li>@param w &#x533A;&#x57DF;&#x7684;&#x5BBD;&#x5EA6;</li>
<li>@param h &#x533A;&#x57DF;&#x7684;&#x9AD8;&#x5EA6;</li>
<li>@param limit &#x9650;&#x5236;&#x4E2A;&#x6570;</li>
<li>@return &#x591A;&#x4E2A;Point &#x5750;&#x6807;&#x70B9;&#x6570;&#x7EC4;&#x6216;&#x8005;null</li>
</ul>
<blockquote>
<pre><code class="lang-javascript">
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">main</span>(<span class="hljs-params"></span>) </span>{
      <span class="hljs-keyword">var</span> req = image.requestScreenCapture(<span class="hljs-number">10000</span>,<span class="hljs-number">0</span>);
        <span class="hljs-keyword">if</span> (!req) {
         req = image.requestScreenCapture(<span class="hljs-number">10000</span>,<span class="hljs-number">0</span>);
      }
      <span class="hljs-keyword">if</span> (!req) {
          toast(<span class="hljs-string">&quot;&#x7533;&#x8BF7;&#x6743;&#x9650;&#x5931;&#x8D25;&quot;</span>);
          <span class="hljs-keyword">return</span>;
      }
      <span class="hljs-keyword">var</span> aimage = image.captureFullScreen();
      <span class="hljs-keyword">if</span> (aimage != <span class="hljs-literal">null</span>) {
          <span class="hljs-keyword">var</span> points = image.findMultiColor(aimage,<span class="hljs-string">&quot;0xDD7A5F-0x101010&quot;</span>, <span class="hljs-string">&quot;29|25|0xBB454B-0x101010,58|44|0xA6363A-0x101010&quot;</span>, <span class="hljs-number">0.9</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">10</span>);
          logd(<span class="hljs-string">&quot;points &quot;</span>+points);
      }

}
main();
</code></pre>
</blockquote>
<h2 id="imagefindmulticolorj"><a name="imagefindmulticolorj" class="anchor-navigation-ex-anchor" href="#imagefindmulticolorj"><i class="fa fa-link" aria-hidden="true"></i></a>4.6. image.findMultiColorJ</h2>
<ul>
<li>&#x591A;&#x70B9;&#x627E;&#x8272;&#xFF0C;&#x627E;&#x5230;&#x6240;&#x6709;&#x7B26;&#x5408;&#x6807;&#x51C6;&#x7684;&#x70B9;&#xFF0C;&#x53C2;&#x6570;&#x4ECE;JSON&#x6587;&#x4EF6;&#x4E2D;&#x8BFB;&#x53D6;&#xFF0C;&#x7C7B;&#x4F3C;&#x4E8E;&#x6309;&#x952E;&#x7CBE;&#x7075;&#x7684;&#x591A;&#x70B9;&#x627E;&#x8272;</li>
<li>@param image      &#x8981;&#x627E;&#x8272;&#x7684;&#x56FE;&#x7247;</li>
<li>@param jsonFileName res&#x6587;&#x4EF6;&#x4E2D;&#x53D6;&#x8272;&#x5DE5;&#x5177;&#x751F;&#x6210;&#x7684;JSON&#x6587;&#x4EF6;&#xFF0C;&#x53EA;&#x8981;&#x586B;&#x5199;&#x6587;&#x4EF6;&#x540D;&#x79F0;&#x5373;&#x53EF;&#xFF0C;&#x540E;&#x7F00;&#x4E0D;&#x7528;&#x586B;&#x5199;</li>
<li>@return &#x591A;&#x4E2A;Point &#x5750;&#x6807;&#x70B9;&#x6570;&#x7EC4;&#x6216;&#x8005;null</li>
</ul>
<blockquote>
<pre><code class="lang-javascript">
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">main</span>(<span class="hljs-params"></span>) </span>{
      <span class="hljs-keyword">var</span> req = image.requestScreenCapture(<span class="hljs-number">10000</span>,<span class="hljs-number">0</span>);
        <span class="hljs-keyword">if</span> (!req) {
         req = image.requestScreenCapture(<span class="hljs-number">10000</span>,<span class="hljs-number">0</span>);
      }
      <span class="hljs-keyword">if</span> (!req) {
          toast(<span class="hljs-string">&quot;&#x7533;&#x8BF7;&#x6743;&#x9650;&#x5931;&#x8D25;&quot;</span>);
          <span class="hljs-keyword">return</span>;
      }
      <span class="hljs-keyword">var</span> aimage = image.captureFullScreen();
      <span class="hljs-keyword">if</span> (aimage != <span class="hljs-literal">null</span>) {
          <span class="hljs-keyword">var</span> points = image.findMultiColorJ(aimage,<span class="hljs-string">&quot;&#x91D1;&#x5E01;&quot;</span>);
          logd(<span class="hljs-string">&quot;points &quot;</span>+points);
      }

}
main();
</code></pre>
</blockquote>
<h2 id="imagefindmulticolorex"><a name="imagefindmulticolorex" class="anchor-navigation-ex-anchor" href="#imagefindmulticolorex"><i class="fa fa-link" aria-hidden="true"></i></a>4.7. image.findMultiColorEx</h2>
<ul>
<li>&#x591A;&#x70B9;&#x627E;&#x8272;&#xFF0C;&#x627E;&#x5230;&#x6240;&#x6709;&#x7B26;&#x5408;&#x6807;&#x51C6;&#x7684;&#x70B9;&#xFF0C;&#x7C7B;&#x4F3C;&#x4E8E;&#x6309;&#x952E;&#x7CBE;&#x7075;&#x7684;&#x591A;&#x70B9;&#x627E;&#x8272;&#x3002;</li>
<li>@param firstColor &#x7B2C;&#x4E00;&#x4E2A;&#x70B9;&#x7684;&#x989C;&#x8272;</li>
<li>@param threshold &#x627E;&#x8272;&#x65F6;&#x989C;&#x8272;&#x76F8;&#x4F3C;&#x5EA6;&#x53D6;&#x503C;&#x4E3A; 0.0 ~ 1.0</li>
<li>@param points     &#x5B57;&#x7B26;&#x4E32;&#x7C7B;&#x4F3C;&#x8FD9;&#x6837; 6|1|0x969696-0x000010,1|12|0x969696,-4|0|0x969696</li>
<li>@param x &#x533A;&#x57DF;&#x7684;X&#x8D77;&#x59CB;&#x5750;&#x6807;</li>
<li>@param y &#x533A;&#x57DF;&#x7684;Y&#x8D77;&#x59CB;&#x5750;&#x6807;</li>
<li>@param w &#x533A;&#x57DF;&#x7684;&#x5BBD;&#x5EA6;</li>
<li>@param h &#x533A;&#x57DF;&#x7684;&#x9AD8;&#x5EA6;</li>
<li>@param limit &#x9650;&#x5236;&#x4E2A;&#x6570;</li>
<li>@return &#x591A;&#x4E2A;Point &#x5750;&#x6807;&#x70B9;&#x6570;&#x7EC4;&#x6216;&#x8005;null</li>
</ul>
<blockquote>
<pre><code class="lang-javascript">
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">main</span>(<span class="hljs-params"></span>) </span>{
      <span class="hljs-keyword">var</span> req = image.requestScreenCapture(<span class="hljs-number">10000</span>,<span class="hljs-number">0</span>);
        <span class="hljs-keyword">if</span> (!req) {
         req = image.requestScreenCapture(<span class="hljs-number">10000</span>,<span class="hljs-number">0</span>);
      }
      <span class="hljs-keyword">if</span> (!req) {
          toast(<span class="hljs-string">&quot;&#x7533;&#x8BF7;&#x6743;&#x9650;&#x5931;&#x8D25;&quot;</span>);
          <span class="hljs-keyword">return</span>;
      }

      <span class="hljs-keyword">var</span> points = image.findMultiColorEx(<span class="hljs-string">&quot;0xDD7A5F-0x101010&quot;</span>, <span class="hljs-string">&quot;29|25|0xBB454B-0x101010,58|44|0xA6363A-0x101010&quot;</span>, <span class="hljs-number">0.9</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">10</span>);
      logd(<span class="hljs-string">&quot;points &quot;</span>+points);


}
main();
</code></pre>
</blockquote>
<h2 id="imagefindmulticolorexj"><a name="imagefindmulticolorexj" class="anchor-navigation-ex-anchor" href="#imagefindmulticolorexj"><i class="fa fa-link" aria-hidden="true"></i></a>4.8. image.findMultiColorExJ</h2>
<ul>
<li>&#x591A;&#x70B9;&#x627E;&#x8272;&#xFF0C;&#x627E;&#x5230;&#x6240;&#x6709;&#x7B26;&#x5408;&#x6807;&#x51C6;&#x7684;&#x70B9;&#xFF0C;&#x81EA;&#x52A8;&#x6293;&#x53D6;&#x5F53;&#x524D;&#x5C4F;&#x5E55;&#x7684;&#x56FE;&#x7247;,&#x53C2;&#x6570;&#x4ECE;JSON&#x6587;&#x4EF6;&#x4E2D;&#x8BFB;&#x53D6;&#xFF0C;&#x7C7B;&#x4F3C;&#x4E8E;&#x6309;&#x952E;&#x7CBE;&#x7075;&#x7684;&#x591A;&#x70B9;&#x627E;&#x8272;</li>
<li>@param jsonFileName res&#x6587;&#x4EF6;&#x4E2D;&#x53D6;&#x8272;&#x5DE5;&#x5177;&#x751F;&#x6210;&#x7684;JSON&#x6587;&#x4EF6;&#xFF0C;&#x53EA;&#x8981;&#x586B;&#x5199;&#x6587;&#x4EF6;&#x540D;&#x79F0;&#x5373;&#x53EF;&#xFF0C;&#x540E;&#x7F00;&#x4E0D;&#x7528;&#x586B;&#x5199;</li>
<li>@return &#x591A;&#x4E2A;Point &#x5750;&#x6807;&#x70B9;&#x6570;&#x7EC4;&#x6216;&#x8005;null</li>
</ul>
<blockquote>
<pre><code class="lang-javascript">
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">main</span>(<span class="hljs-params"></span>) </span>{
      <span class="hljs-keyword">var</span> req = image.requestScreenCapture(<span class="hljs-number">10000</span>,<span class="hljs-number">0</span>);
        <span class="hljs-keyword">if</span> (!req) {
         req = image.requestScreenCapture(<span class="hljs-number">10000</span>,<span class="hljs-number">0</span>);
      }
      <span class="hljs-keyword">if</span> (!req) {
          toast(<span class="hljs-string">&quot;&#x7533;&#x8BF7;&#x6743;&#x9650;&#x5931;&#x8D25;&quot;</span>);
          <span class="hljs-keyword">return</span>;
      }
      <span class="hljs-keyword">var</span> points = image.findMultiColorExJ(<span class="hljs-string">&quot;&#x91D1;&#x5E01;&quot;</span>);
      logd(<span class="hljs-string">&quot;points &quot;</span>+points);


}
main();
</code></pre>
</blockquote>
<h1 id="&#x627E;&#x56FE;"><a name="&#x627E;&#x56FE;" class="anchor-navigation-ex-anchor" href="#&#x627E;&#x56FE;"><i class="fa fa-link" aria-hidden="true"></i></a>5. &#x627E;&#x56FE;</h1>
<h2 id="imagefindimage"><a name="imagefindimage" class="anchor-navigation-ex-anchor" href="#imagefindimage"><i class="fa fa-link" aria-hidden="true"></i></a>5.1. image.findImage</h2>
<ul>
<li>&#x627E;&#x56FE;&#x3002;&#x5728;&#x5927;&#x56FE;&#x7247;image&#x4E2D;&#x67E5;&#x627E;&#x5C0F;&#x56FE;&#x7247;template&#x7684;&#x4F4D;&#x7F6E;&#xFF08;&#x6A21;&#x5757;&#x5339;&#x914D;&#xFF09;&#xFF0C;&#x627E;&#x5230;&#x65F6;&#x8FD4;&#x56DE;&#x4F4D;&#x7F6E;&#x5750;&#x6807;&#x533A;&#x57DF;(Rect)&#xFF0C;&#x627E;&#x4E0D;&#x5230;&#x65F6;&#x8FD4;&#x56DE;null&#x3002;</li>
<li>@param image     &#x5927;&#x56FE;&#x7247;</li>
<li>@param template  &#x5C0F;&#x56FE;&#x7247;&#xFF08;&#x6A21;&#x677F;&#xFF09;</li>
<li>@param x         &#x627E;&#x56FE;&#x533A;&#x57DF; x &#x8D77;&#x59CB;&#x5750;&#x6807;</li>
<li>@param y         &#x627E;&#x56FE;&#x533A;&#x57DF; y &#x8D77;&#x59CB;&#x5750;&#x6807;</li>
<li>@param w         &#x627E;&#x56FE;&#x533A;&#x57DF; w &#x5BBD;&#x5EA6;</li>
<li>@param h         &#x627E;&#x56FE;&#x533A;&#x57DF; h &#x9AD8;&#x5EA6;</li>
<li>@param threshold &#x56FE;&#x7247;&#x76F8;&#x4F3C;&#x5EA6;&#x3002;&#x53D6;&#x503C;&#x8303;&#x56F4;&#x4E3A;0~1&#x7684;&#x6D6E;&#x70B9;&#x6570;&#x3002;&#x9ED8;&#x8BA4;&#x503C;&#x4E3A;0.9&#x3002;</li>
<li>@param limit &#x9650;&#x5236;&#x7ED3;&#x679C;&#x7684;&#x6570;&#x91CF;&#xFF0C;&#x5982;&#x679C;&#x8981;&#x627E;&#x5230;1&#x4E2A;&#xFF0C;&#x5C31;&#x586B;&#x5199;1&#xFF0C;&#x5982;&#x679C;&#x662F;&#x591A;&#x4E2A;&#x8BF7;&#x586B;&#x5199;&#x591A;&#x4E2A;</li>
<li>@return Rect &#x533A;&#x57DF;&#x5750;&#x6807;&#x5BF9;&#x8C61;&#x6216;&#x8005;null</li>
</ul>
<blockquote>
<pre><code class="lang-javascript">
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">main</span>(<span class="hljs-params"></span>) </span>{
    <span class="hljs-keyword">var</span> request = image.requestScreenCapture(<span class="hljs-number">10000</span>,<span class="hljs-number">0</span>);
    <span class="hljs-keyword">if</span> (request){
        toast(<span class="hljs-string">&quot;&#x7533;&#x8BF7;&#x6210;&#x529F;&quot;</span>);
    }<span class="hljs-keyword">else</span> {
       toast(<span class="hljs-string">&quot;&#x7533;&#x8BF7;&#x5931;&#x8D25;&quot;</span>);
        exit();
    }
    sleep(<span class="hljs-number">5000</span>);
    <span class="hljs-comment">//&#x4ECE;&#x5DE5;&#x7A0B;&#x76EE;&#x5F55;&#x4E0B;res&#x6587;&#x4EF6;&#x5939;&#x4E0B;&#x8BFB;&#x53D6;sms.png&#x6587;&#x4EF6;</span>
   <span class="hljs-keyword">var</span> sms=readResAutoImage(<span class="hljs-string">&quot;sms.png&quot;</span>);
    <span class="hljs-comment">//&#x5728;&#x5F53;&#x524D;&#x5C4F;&#x5E55;&#x4E2D;&#x67E5;&#x627E;&#xFF0C;&#x5E76;&#x4E14;&#x9650;&#x5236;&#x53EA;&#x67E5;&#x627E;&#x4E00;&#x4E2A;</span>
    <span class="hljs-keyword">var</span> point = image.findImageEx( sms, <span class="hljs-number">1</span>);
    logd(<span class="hljs-string">&quot;point &quot;</span>+point);
    <span class="hljs-comment">//&#x6293;&#x53D6;&#x5C4F;&#x5E55;</span>
   <span class="hljs-keyword">var</span> aimage = image.captureFullScreen();
    logd(<span class="hljs-string">&quot;aimage &quot;</span>+aimage);
    <span class="hljs-keyword">if</span> (aimage != <span class="hljs-literal">null</span>) {
        <span class="hljs-comment">//&#x5728;&#x56FE;&#x7247;&#x4E2D;&#x67E5;&#x627E;</span>
        point = image.findImage(aimage, sms,<span class="hljs-number">0</span>,<span class="hljs-number">0</span>,<span class="hljs-number">0</span>,<span class="hljs-number">0</span>,<span class="hljs-number">1</span>, <span class="hljs-number">1</span>);
        logd(<span class="hljs-string">&quot;point &quot;</span>+point);
    }
}

main();
</code></pre>
</blockquote>
<h2 id="imagefindimageex"><a name="imagefindimageex" class="anchor-navigation-ex-anchor" href="#imagefindimageex"><i class="fa fa-link" aria-hidden="true"></i></a>5.2. image.findImageEx</h2>
<ul>
<li>&#x627E;&#x56FE;&#x3002;&#x5728;&#x5F53;&#x524D;&#x5C4F;&#x5E55;&#x4E2D;&#x67E5;&#x627E;&#x5C0F;&#x56FE;&#x7247;template&#x7684;&#x4F4D;&#x7F6E;&#xFF08;&#x6A21;&#x5757;&#x5339;&#x914D;&#xFF09;&#xFF0C;&#x627E;&#x5230;&#x65F6;&#x8FD4;&#x56DE;&#x4F4D;&#x7F6E;&#x5750;&#x6807;&#x533A;&#x57DF;(Rect)&#xFF0C;&#x627E;&#x4E0D;&#x5230;&#x65F6;&#x8FD4;&#x56DE;null&#x3002;</li>
<li>@param template  &#x5C0F;&#x56FE;&#x7247;&#xFF08;&#x6A21;&#x677F;&#xFF09;</li>
<li>@param x         &#x627E;&#x56FE;&#x533A;&#x57DF; x &#x8D77;&#x59CB;&#x5750;&#x6807;</li>
<li>@param y         &#x627E;&#x56FE;&#x533A;&#x57DF; y &#x8D77;&#x59CB;&#x5750;&#x6807;</li>
<li>@param w         &#x627E;&#x56FE;&#x533A;&#x57DF; w &#x5BBD;&#x5EA6;</li>
<li>@param h         &#x627E;&#x56FE;&#x533A;&#x57DF; h &#x9AD8;&#x5EA6;</li>
<li>@param threshold &#x56FE;&#x7247;&#x76F8;&#x4F3C;&#x5EA6;&#x3002;&#x53D6;&#x503C;&#x8303;&#x56F4;&#x4E3A;0~1&#x7684;&#x6D6E;&#x70B9;&#x6570;&#x3002;&#x9ED8;&#x8BA4;&#x503C;&#x4E3A;0.9&#x3002;</li>
<li>@param limit &#x9650;&#x5236;&#x7ED3;&#x679C;&#x7684;&#x6570;&#x91CF;&#xFF0C;&#x5982;&#x679C;&#x8981;&#x627E;&#x5230;1&#x4E2A;&#xFF0C;&#x5C31;&#x586B;&#x5199;1&#xFF0C;&#x5982;&#x679C;&#x662F;&#x591A;&#x4E2A;&#x8BF7;&#x586B;&#x5199;&#x591A;&#x4E2A;</li>
<li>@return Rect &#x533A;&#x57DF;&#x5750;&#x6807;&#x5BF9;&#x8C61;&#x6570;&#x7EC4;&#x6216;&#x8005;null</li>
</ul>
<blockquote>
<pre><code class="lang-javascript">
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">main</span>(<span class="hljs-params"></span>) </span>{
    <span class="hljs-keyword">var</span> request = image.requestScreenCapture(<span class="hljs-number">10000</span>,<span class="hljs-number">0</span>);
    <span class="hljs-keyword">if</span> (request){
        toast(<span class="hljs-string">&quot;&#x7533;&#x8BF7;&#x6210;&#x529F;&quot;</span>);
    }<span class="hljs-keyword">else</span> {
       toast(<span class="hljs-string">&quot;&#x7533;&#x8BF7;&#x5931;&#x8D25;&quot;</span>);
        exit();
    }
    sleep(<span class="hljs-number">5000</span>);
    <span class="hljs-comment">//&#x4ECE;&#x5DE5;&#x7A0B;&#x76EE;&#x5F55;&#x4E0B;res&#x6587;&#x4EF6;&#x5939;&#x4E0B;&#x8BFB;&#x53D6;sms.png&#x6587;&#x4EF6;</span>
   <span class="hljs-keyword">var</span> sms=readResAutoImage(<span class="hljs-string">&quot;sms.png&quot;</span>);
    <span class="hljs-comment">//&#x5728;&#x5F53;&#x524D;&#x5C4F;&#x5E55;&#x4E2D;&#x67E5;&#x627E;&#xFF0C;&#x5E76;&#x4E14;&#x9650;&#x5236;&#x53EA;&#x67E5;&#x627E;&#x4E00;&#x4E2A;</span>
    <span class="hljs-keyword">var</span> point = image.findImageEx(sms,<span class="hljs-number">0</span>,<span class="hljs-number">0</span>,<span class="hljs-number">0</span>,<span class="hljs-number">0</span>,<span class="hljs-number">1</span>, <span class="hljs-number">1</span>);
    logd(<span class="hljs-string">&quot;point &quot;</span>+point);
}

main();
</code></pre>
</blockquote>
<h2 id="imagematchtemplate-&#x6A21;&#x677F;&#x5339;&#x914D;"><a name="imagematchtemplate-&#x6A21;&#x677F;&#x5339;&#x914D;" class="anchor-navigation-ex-anchor" href="#imagematchtemplate-&#x6A21;&#x677F;&#x5339;&#x914D;"><i class="fa fa-link" aria-hidden="true"></i></a>5.3. image.matchTemplate &#x6A21;&#x677F;&#x5339;&#x914D;</h2>
<ul>
<li>OpenCV&#x6A21;&#x677F;&#x5339;&#x914D;&#x5C01;&#x88C5;</li>
<li>@param image         &#x5927;&#x56FE;&#x7247;</li>
<li>@param template      &#x5C0F;&#x56FE;&#x7247;&#xFF08;&#x6A21;&#x677F;&#xFF09;</li>
<li>@param weakThreshold &#x56FE;&#x7247;&#x76F8;&#x4F3C;&#x5EA6;&#x3002;&#x53D6;&#x503C;&#x8303;&#x56F4;&#x4E3A;0~1&#x7684;&#x6D6E;&#x70B9;&#x6570;&#x3002;&#x9ED8;&#x8BA4;&#x503C;&#x4E3A;0.9&#x3002;</li>
<li>@param threshold     &#x56FE;&#x7247;&#x76F8;&#x4F3C;&#x5EA6;&#x3002;&#x53D6;&#x503C;&#x8303;&#x56F4;&#x4E3A;0~1&#x7684;&#x6D6E;&#x70B9;&#x6570;&#x3002;&#x9ED8;&#x8BA4;&#x503C;&#x4E3A;0.9&#x3002;</li>
<li>@param rect          &#x627E;&#x56FE;&#x533A;&#x57DF;&#x3002;&#x53C2;&#x89C1;findColor&#x51FD;&#x6570;&#x5173;&#x4E8E; rect &#x7684;&#x8BF4;&#x660E;&#x3002;</li>
<li>@param maxLevel      &#x9ED8;&#x8BA4;&#x4E3A;-1&#xFF0C;&#x4E00;&#x822C;&#x800C;&#x8A00;&#x4E0D;&#x5FC5;&#x4FEE;&#x6539;&#x6B64;&#x53C2;&#x6570;&#x3002;&#x4E0D;&#x52A0;&#x6B64;&#x53C2;&#x6570;&#x65F6;&#x8BE5;&#x53C2;&#x6570;&#x4F1A;&#x6839;&#x636E;&#x56FE;&#x7247;&#x5927;&#x5C0F;&#x81EA;&#x52A8;&#x8C03;&#x6574;&#x3002;&#x627E;&#x56FE;&#x7B97;&#x6CD5;&#x662F;&#x91C7;&#x7528;&#x56FE;&#x50CF;&#x91D1;&#x5B57;&#x5854;&#x8FDB;&#x884C;&#x7684;, level&#x53C2;&#x6570;&#x8868;&#x793A;&#x91D1;&#x5B57;&#x5854;&#x7684;&#x5C42;&#x6B21;,
level&#x8D8A;&#x5927;&#x53EF;&#x80FD;&#x5E26;&#x6765;&#x8D8A;&#x9AD8;&#x7684;&#x627E;&#x56FE;&#x6548;&#x7387;&#xFF0C;&#x4F46;&#x4E5F;&#x53EF;&#x80FD;&#x9020;&#x6210;&#x627E;&#x56FE;&#x5931;&#x8D25;&#xFF08;&#x56FE;&#x7247;&#x56E0;&#x8FC7;&#x5EA6;&#x7F29;&#x5C0F;&#x800C;&#x65E0;&#x6CD5;&#x5206;&#x8FA8;&#xFF09;&#x6216;&#x8FD4;&#x56DE;&#x9519;&#x8BEF;&#x4F4D;&#x7F6E;&#x3002;&#x56E0;&#x6B64;&#xFF0C;&#x9664;&#x975E;&#x60A8;&#x6E05;&#x695A;&#x8BE5;&#x53C2;&#x6570;&#x7684;&#x610F;&#x4E49;&#x5E76;&#x9700;&#x8981;&#x8FDB;&#x884C;&#x6027;&#x80FD;&#x8C03;&#x4F18;&#xFF0C;&#x5426;&#x5219;&#x4E0D;&#x9700;&#x8981;&#x7528;&#x5230;&#x8BE5;&#x53C2;&#x6570;&#x3002;</li>
<li>@param limit &#x9650;&#x5236;&#x7ED3;&#x679C;&#x7684;&#x6570;&#x91CF;&#xFF0C;&#x5982;&#x679C;&#x8981;&#x627E;&#x5230;1&#x4E2A;&#xFF0C;&#x5C31;&#x586B;&#x5199;1&#xFF0C;&#x5982;&#x679C;&#x662F;&#x591A;&#x4E2A;&#x8BF7;&#x586B;&#x5199;&#x591A;&#x4E2A;</li>
<li>@return Match&#x96C6;&#x5408; &#x6216;&#x8005;null</li>
</ul>
<blockquote>
<pre><code class="lang-javascript">
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">main</span>(<span class="hljs-params"></span>) </span>{
     <span class="hljs-keyword">var</span> req = image.requestScreenCapture(<span class="hljs-number">10000</span>,<span class="hljs-number">0</span>);
     <span class="hljs-keyword">if</span> (!req) {
         req = image.requestScreenCapture(<span class="hljs-number">10000</span>,<span class="hljs-number">0</span>);
     }
     <span class="hljs-keyword">if</span> (!req) {
         toast(<span class="hljs-string">&quot;&#x7533;&#x8BF7;&#x6743;&#x9650;&#x5931;&#x8D25;&quot;</span>);
         <span class="hljs-keyword">return</span>;
     }
     <span class="hljs-keyword">var</span> aimage = image.captureFullScreen();
     <span class="hljs-keyword">if</span> (aimage != <span class="hljs-literal">null</span>) {
        <span class="hljs-keyword">var</span> temp = readResAutoImage(<span class="hljs-string">&quot;tmp.png&quot;</span>);
        <span class="hljs-keyword">var</span> rectp= <span class="hljs-keyword">new</span> Rect();
        rectp.left=<span class="hljs-number">10</span>;
        rectp.top=<span class="hljs-number">100</span>;
        rectp.right=<span class="hljs-number">100</span>;
        rectp.bottom=<span class="hljs-number">400</span>;
         <span class="hljs-keyword">var</span> x = image.matchTemplate(aimage, temp,<span class="hljs-number">0.9</span>,<span class="hljs-number">0.9</span>,rectp,<span class="hljs-number">-1</span>,<span class="hljs-number">1</span>);
         logd(x);
     }
}
main();
</code></pre>
</blockquote>
<h2 id="imagematchtemplateex-&#x6A21;&#x677F;&#x5339;&#x914D;"><a name="imagematchtemplateex-&#x6A21;&#x677F;&#x5339;&#x914D;" class="anchor-navigation-ex-anchor" href="#imagematchtemplateex-&#x6A21;&#x677F;&#x5339;&#x914D;"><i class="fa fa-link" aria-hidden="true"></i></a>5.4. image.matchTemplateEx &#x6A21;&#x677F;&#x5339;&#x914D;</h2>
<ul>
<li>OpenCV&#x6A21;&#x677F;&#x5339;&#x914D;&#x5C01;&#x88C5;&#xFF0C;&#x5728;&#x5F53;&#x524D;&#x5C4F;&#x5E55;&#x622A;&#x56FE;&#x4E2D;&#x8FDB;&#x884C;&#x5339;&#x914D;</li>
<li>@param template      &#x5C0F;&#x56FE;&#x7247;&#xFF08;&#x6A21;&#x677F;&#xFF09;</li>
<li>@param weakThreshold &#x56FE;&#x7247;&#x76F8;&#x4F3C;&#x5EA6;&#x3002;&#x53D6;&#x503C;&#x8303;&#x56F4;&#x4E3A;0~1&#x7684;&#x6D6E;&#x70B9;&#x6570;&#x3002;&#x9ED8;&#x8BA4;&#x503C;&#x4E3A;0.9&#x3002;</li>
<li>@param threshold     &#x56FE;&#x7247;&#x76F8;&#x4F3C;&#x5EA6;&#x3002;&#x53D6;&#x503C;&#x8303;&#x56F4;&#x4E3A;0~1&#x7684;&#x6D6E;&#x70B9;&#x6570;&#x3002;&#x9ED8;&#x8BA4;&#x503C;&#x4E3A;0.9&#x3002;</li>
<li>@param rect          &#x627E;&#x56FE;&#x533A;&#x57DF;&#x3002;&#x53C2;&#x89C1;findColor&#x51FD;&#x6570;&#x5173;&#x4E8E; rect &#x7684;&#x8BF4;&#x660E;&#x3002;</li>
<li>@param maxLevel      &#x9ED8;&#x8BA4;&#x4E3A;-1&#xFF0C;&#x4E00;&#x822C;&#x800C;&#x8A00;&#x4E0D;&#x5FC5;&#x4FEE;&#x6539;&#x6B64;&#x53C2;&#x6570;&#x3002;&#x4E0D;&#x52A0;&#x6B64;&#x53C2;&#x6570;&#x65F6;&#x8BE5;&#x53C2;&#x6570;&#x4F1A;&#x6839;&#x636E;&#x56FE;&#x7247;&#x5927;&#x5C0F;&#x81EA;&#x52A8;&#x8C03;&#x6574;&#x3002;&#x627E;&#x56FE;&#x7B97;&#x6CD5;&#x662F;&#x91C7;&#x7528;&#x56FE;&#x50CF;&#x91D1;&#x5B57;&#x5854;&#x8FDB;&#x884C;&#x7684;, level&#x53C2;&#x6570;&#x8868;&#x793A;&#x91D1;&#x5B57;&#x5854;&#x7684;&#x5C42;&#x6B21;,
level&#x8D8A;&#x5927;&#x53EF;&#x80FD;&#x5E26;&#x6765;&#x8D8A;&#x9AD8;&#x7684;&#x627E;&#x56FE;&#x6548;&#x7387;&#xFF0C;&#x4F46;&#x4E5F;&#x53EF;&#x80FD;&#x9020;&#x6210;&#x627E;&#x56FE;&#x5931;&#x8D25;&#xFF08;&#x56FE;&#x7247;&#x56E0;&#x8FC7;&#x5EA6;&#x7F29;&#x5C0F;&#x800C;&#x65E0;&#x6CD5;&#x5206;&#x8FA8;&#xFF09;&#x6216;&#x8FD4;&#x56DE;&#x9519;&#x8BEF;&#x4F4D;&#x7F6E;&#x3002;&#x56E0;&#x6B64;&#xFF0C;&#x9664;&#x975E;&#x60A8;&#x6E05;&#x695A;&#x8BE5;&#x53C2;&#x6570;&#x7684;&#x610F;&#x4E49;&#x5E76;&#x9700;&#x8981;&#x8FDB;&#x884C;&#x6027;&#x80FD;&#x8C03;&#x4F18;&#xFF0C;&#x5426;&#x5219;&#x4E0D;&#x9700;&#x8981;&#x7528;&#x5230;&#x8BE5;&#x53C2;&#x6570;&#x3002;</li>
<li>@param limit &#x9650;&#x5236;&#x7ED3;&#x679C;&#x7684;&#x6570;&#x91CF;&#xFF0C;&#x5982;&#x679C;&#x8981;&#x627E;&#x5230;1&#x4E2A;&#xFF0C;&#x5C31;&#x586B;&#x5199;1&#xFF0C;&#x5982;&#x679C;&#x662F;&#x591A;&#x4E2A;&#x8BF7;&#x586B;&#x5199;&#x591A;&#x4E2A;</li>
<li>@return Match&#x96C6;&#x5408; &#x6216;&#x8005;null</li>
</ul>
<blockquote>
<pre><code class="lang-javascript">
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">main</span>(<span class="hljs-params"></span>) </span>{
     <span class="hljs-keyword">var</span> req = image.requestScreenCapture(<span class="hljs-number">10000</span>,<span class="hljs-number">0</span>);
     <span class="hljs-keyword">if</span> (!req) {
         req = image.requestScreenCapture(<span class="hljs-number">10000</span>,<span class="hljs-number">0</span>);
     }
     <span class="hljs-keyword">if</span> (!req) {
         toast(<span class="hljs-string">&quot;&#x7533;&#x8BF7;&#x6743;&#x9650;&#x5931;&#x8D25;&quot;</span>);
         <span class="hljs-keyword">return</span>;
     }
     <span class="hljs-keyword">var</span> aimage = image.captureFullScreen();
     <span class="hljs-keyword">if</span> (aimage != <span class="hljs-literal">null</span>) {
        <span class="hljs-keyword">var</span> temp = readResAutoImage(<span class="hljs-string">&quot;tmp.png&quot;</span>);
        <span class="hljs-keyword">var</span> rectp= <span class="hljs-keyword">new</span> Rect();
        rectp.left=<span class="hljs-number">10</span>;
        rectp.top=<span class="hljs-number">100</span>;
        rectp.right=<span class="hljs-number">100</span>;
        rectp.bottom=<span class="hljs-number">400</span>;
         <span class="hljs-keyword">var</span> x = image.matchTemplateEx( temp,<span class="hljs-number">0.9</span>,<span class="hljs-number">0.9</span>,rectp,<span class="hljs-number">-1</span>,<span class="hljs-number">1</span>);
         logd(x);
     }
}
main();
</code></pre>
</blockquote>
<h1 id="&#x5176;&#x4ED6;"><a name="&#x5176;&#x4ED6;" class="anchor-navigation-ex-anchor" href="#&#x5176;&#x4ED6;"><i class="fa fa-link" aria-hidden="true"></i></a>6. &#x5176;&#x4ED6;</h1>
<h2 id="imagereadimage"><a name="imagereadimage" class="anchor-navigation-ex-anchor" href="#imagereadimage"><i class="fa fa-link" aria-hidden="true"></i></a>6.1. image.readImage</h2>
<ul>
<li>&#x8BFB;&#x53D6;&#x5728;&#x8DEF;&#x5F84;path&#x7684;&#x56FE;&#x7247;&#x6587;&#x4EF6;&#x5E76;&#x8FD4;&#x56DE;&#x4E00;&#x4E2A;{@link AutoImage}&#x5BF9;&#x8C61;&#x3002;&#x5982;&#x679C;&#x6587;&#x4EF6;&#x4E0D;&#x5B58;&#x5728;&#x6216;&#x8005;&#x6587;&#x4EF6;&#x65E0;&#x6CD5;&#x89E3;&#x7801;&#x5219;&#x8FD4;&#x56DE;null&#x3002;</li>
<li>@param path &#x56FE;&#x7247;&#x8DEF;&#x5F84;</li>
<li>@return AutoImage &#x5BF9;&#x8C61;&#x6216;&#x8005;null</li>
</ul>
<blockquote>
<pre><code class="lang-javascript">
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">main</span>(<span class="hljs-params"></span>) </span>{
    <span class="hljs-keyword">var</span> autoimg = image.readImage(<span class="hljs-string">&quot;/sdcard/a.png&quot;</span>);
}
main();
</code></pre>
</blockquote>
<h2 id="imagereadbitmap"><a name="imagereadbitmap" class="anchor-navigation-ex-anchor" href="#imagereadbitmap"><i class="fa fa-link" aria-hidden="true"></i></a>6.2. image.readBitmap</h2>
<ul>
<li>&#x8BFB;&#x53D6;&#x5728;&#x8DEF;&#x5F84;path&#x7684;&#x56FE;&#x7247;&#x6587;&#x4EF6;&#x5E76;&#x8FD4;&#x56DE;&#x4E00;&#x4E2A;{@link AutoImage}&#x5BF9;&#x8C61;&#x3002;&#x5982;&#x679C;&#x6587;&#x4EF6;&#x4E0D;&#x5B58;&#x5728;&#x6216;&#x8005;&#x6587;&#x4EF6;&#x65E0;&#x6CD5;&#x89E3;&#x7801;&#x5219;&#x8FD4;&#x56DE;null&#x3002;</li>
<li>@param path &#x56FE;&#x7247;&#x8DEF;&#x5F84;</li>
<li>@return android&#x7684;bitmap&#x5BF9;&#x8C61;&#x6216;&#x8005;null</li>
</ul>
<blockquote>
<pre><code class="lang-javascript">
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">main</span>(<span class="hljs-params"></span>) </span>{
    <span class="hljs-keyword">var</span> autoimg = image.readBitmap(<span class="hljs-string">&quot;/sdcard/a.png&quot;</span>);
}
main();
</code></pre>
</blockquote>
<h2 id="imagepixelinimage"><a name="imagepixelinimage" class="anchor-navigation-ex-anchor" href="#imagepixelinimage"><i class="fa fa-link" aria-hidden="true"></i></a>6.3. image.pixelInImage</h2>
<ul>
<li>&#x8FD4;&#x56DE;&#x56FE;&#x7247;image&#x5728;&#x70B9;(x, y)&#x5904;&#x7684;&#x50CF;&#x7D20;&#x7684;ARGB&#x503C;&#x3002;</li>
<li>&#x8BE5;&#x503C;&#x7684;&#x683C;&#x5F0F;&#x4E3A;0xAARRGGBB&#xFF0C;&#x662F;&#x4E00;&#x4E2A;&quot;32&#x4F4D;&#x6574;&#x6570;&quot;</li>
<li>&#x5750;&#x6807;&#x7CFB;&#x4EE5;&#x56FE;&#x7247;&#x5DE6;&#x4E0A;&#x89D2;&#x4E3A;&#x539F;&#x70B9;&#x3002;&#x4EE5;&#x56FE;&#x7247;&#x5DE6;&#x4FA7;&#x8FB9;&#x4E3A;y&#x8F74;&#xFF0C;&#x4E0A;&#x4FA7;&#x8FB9;&#x4E3A;x&#x8F74;&#x3002;</li>
<li>@param image &#x56FE;&#x7247;</li>
<li>@param x     &#x8981;&#x83B7;&#x53D6;&#x7684;&#x50CF;&#x7D20;&#x7684;&#x6A2A;&#x5750;&#x6807;&#x3002;</li>
<li>@param y     &#x8981;&#x83B7;&#x53D6;&#x7684;&#x50CF;&#x7D20;&#x7684;&#x7EB5;&#x5750;&#x6807;&#x3002;</li>
<li>@return &#x6574;&#x578B;</li>
</ul>
<blockquote>
<pre><code class="lang-javascript">
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">main</span>(<span class="hljs-params"></span>) </span>{
    <span class="hljs-keyword">var</span> imageX = image.captureFullScreen();
    <span class="hljs-keyword">var</span> color = image.pixelInImage(imageX,<span class="hljs-number">100</span>,<span class="hljs-number">100</span>);
}
main();
</code></pre>
</blockquote>
<h2 id="imagegetpixelbitmap"><a name="imagegetpixelbitmap" class="anchor-navigation-ex-anchor" href="#imagegetpixelbitmap"><i class="fa fa-link" aria-hidden="true"></i></a>6.4. image.getPixelBitmap</h2>
<ul>
<li>&#x53D6;&#x5F97;Bitmap&#x56FE;&#x7247;&#x7684;&#x67D0;&#x4E2A;&#x70B9;&#x7684;&#x989C;&#x8272;&#x503C;</li>
<li>@param bitmap &#x56FE;&#x7247;&#x5BF9;&#x8C61;</li>
<li>@param x x&#x5750;&#x6807;&#x70B9;</li>
<li>@param y y&#x5750;&#x6807;&#x70B9;</li>
<li>@return int &#x989C;&#x8272;&#x503C;</li>
</ul>
<blockquote>
<pre><code class="lang-javascript">
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">main</span>(<span class="hljs-params"></span>) </span>{
    <span class="hljs-keyword">var</span> bitmap = image.captureScreenBitmap(<span class="hljs-string">&quot;jpg&quot;</span>,<span class="hljs-number">800</span>,<span class="hljs-number">800</span>,<span class="hljs-number">100</span>,<span class="hljs-number">100</span>,<span class="hljs-number">100</span>);
    <span class="hljs-keyword">var</span> color = image.getPixelBitmap(bitmap,<span class="hljs-number">100</span>,<span class="hljs-number">100</span>);
}
main();
</code></pre>
</blockquote>
<h2 id="imagegetpixelsbitmap"><a name="imagegetpixelsbitmap" class="anchor-navigation-ex-anchor" href="#imagegetpixelsbitmap"><i class="fa fa-link" aria-hidden="true"></i></a>6.5. image.getPixelsBitmap</h2>
<ul>
<li>&#x53D6;&#x5F97;Bitmap&#x56FE;&#x7247;&#x7684;&#x67D0;&#x4E2A;&#x533A;&#x57DF;&#x70B9;&#x7684;&#x989C;&#x8272;&#x503C;&#xFF0C;&#x7B49;&#x540C;&#x4E8E; Bitmap.getPixels</li>
<li>@param bitmap &#x56FE;&#x7247;&#x5BF9;&#x8C61;</li>
<li>@param arraySize &#x8981;&#x8FD4;&#x56DE;&#x7684;&#x533A;&#x57DF;&#x6570;&#x7EC4;&#x7684;&#x5927;&#x5C0F;</li>
<li>@param offset      &#x5199;&#x5165;&#x5230;pixels[]&#x4E2D;&#x7684;&#x7B2C;&#x4E00;&#x4E2A;&#x50CF;&#x7D20;&#x7D22;&#x5F15;&#x503C;</li>
<li>@param stride      pixels[]&#x4E2D;&#x7684;&#x884C;&#x95F4;&#x8DDD;&#x4E2A;&#x6570;&#x503C;(&#x5FC5;&#x987B;&#x5927;&#x4E8E;&#x7B49;&#x4E8E;&#x4F4D;&#x56FE;&#x5BBD;&#x5EA6;)&#x3002;&#x53EF;&#x4EE5;&#x4E3A;&#x8D1F;&#x6570;</li>
<li>@param x          &#x3000;&#x4ECE;&#x4F4D;&#x56FE;&#x4E2D;&#x8BFB;&#x53D6;&#x7684;&#x7B2C;&#x4E00;&#x4E2A;&#x50CF;&#x7D20;&#x7684;x&#x5750;&#x6807;&#x503C;&#x3002;</li>
<li>@param y           &#x4ECE;&#x4F4D;&#x56FE;&#x4E2D;&#x8BFB;&#x53D6;&#x7684;&#x7B2C;&#x4E00;&#x4E2A;&#x50CF;&#x7D20;&#x7684;y&#x5750;&#x6807;&#x503C;</li>
<li>@param width    &#x3000;&#x3000;&#x4ECE;&#x6BCF;&#x4E00;&#x884C;&#x4E2D;&#x8BFB;&#x53D6;&#x7684;&#x50CF;&#x7D20;&#x5BBD;&#x5EA6;</li>
<li>@param height &#x3000;&#x3000;&#x3000;&#x8BFB;&#x53D6;&#x7684;&#x884C;&#x6570;</li>
<li>@return int &#x989C;&#x8272;&#x503C;&#x6570;&#x7EC4;</li>
</ul>
<blockquote>
<pre><code class="lang-javascript">
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">main</span>(<span class="hljs-params"></span>) </span>{
    <span class="hljs-keyword">var</span> bitmap = image.captureScreenBitmap(<span class="hljs-string">&quot;jpg&quot;</span>,<span class="hljs-number">800</span>,<span class="hljs-number">800</span>,<span class="hljs-number">100</span>,<span class="hljs-number">100</span>,<span class="hljs-number">100</span>);
     <span class="hljs-keyword">var</span> w = bitmap.getWidth();
     <span class="hljs-keyword">var</span> h =bitmap.getHeight();
   <span class="hljs-keyword">var</span> mPixels =  image.getPixelsBitmap(bitmap,w*h, <span class="hljs-number">0</span>, w, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>,w, h);
}
main();
</code></pre>
</blockquote>
<h1 id="&#x56FE;&#x7247;&#x8F6C;&#x6362;"><a name="&#x56FE;&#x7247;&#x8F6C;&#x6362;" class="anchor-navigation-ex-anchor" href="#&#x56FE;&#x7247;&#x8F6C;&#x6362;"><i class="fa fa-link" aria-hidden="true"></i></a>7. &#x56FE;&#x7247;&#x8F6C;&#x6362;</h1>
<h2 id="imagesaveto"><a name="imagesaveto" class="anchor-navigation-ex-anchor" href="#imagesaveto"><i class="fa fa-link" aria-hidden="true"></i></a>7.1. image.saveTo</h2>
<ul>
<li>&#x4FDD;&#x5B58;&#x5230;&#x6587;&#x4EF6;&#x4E2D;</li>
<li>@param img &#x56FE;&#x7247;&#x5BF9;&#x8C61;</li>
<li>@param path &#x8DEF;&#x5F84;</li>
<li>@return bool true&#x4EE3;&#x8868;&#x6210;&#x529F;&#xFF0C;false &#x4EE3;&#x8868;&#x5931;&#x8D25;</li>
</ul>
<blockquote>
<pre><code class="lang-javascript">
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">main</span>(<span class="hljs-params"></span>) </span>{
    <span class="hljs-keyword">var</span> imageX = image.captureFullScreen();
    <span class="hljs-keyword">var</span> r = image.saveTo(imageX,<span class="hljs-string">&quot;/sdard/a.png&quot;</span>);
    toast(<span class="hljs-string">&quot;result &quot;</span>+r);
}
main();
</code></pre>
</blockquote>
<h2 id="imagetobase64"><a name="imagetobase64" class="anchor-navigation-ex-anchor" href="#imagetobase64"><i class="fa fa-link" aria-hidden="true"></i></a>7.2. image.toBase64</h2>
<ul>
<li>&#x8F6C;&#x6210;base64&#x7684;&#x5B57;&#x7B26;&#x4E32;</li>
<li>@param img &#x56FE;&#x7247;&#x5BF9;&#x8C61;</li>
<li>@return string</li>
</ul>
<blockquote>
<pre><code class="lang-javascript">
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">main</span>(<span class="hljs-params"></span>) </span>{
    <span class="hljs-keyword">var</span> imageX = image.captureFullScreen();
    <span class="hljs-keyword">var</span> r = image.toBase64(imageX);
    toast(<span class="hljs-string">&quot;result &quot;</span>+r);
}
main();
</code></pre>
</blockquote>
<h2 id="imageclip"><a name="imageclip" class="anchor-navigation-ex-anchor" href="#imageclip"><i class="fa fa-link" aria-hidden="true"></i></a>7.3. image.clip</h2>
<ul>
<li>&#x526A;&#x5207;&#x56FE;&#x7247;</li>
<li>@param img &#x56FE;&#x7247;&#x5BF9;&#x8C61;</li>
<li>@param x x&#x8D77;&#x59CB;&#x5750;&#x6807;</li>
<li>@param y y&#x8D77;&#x59CB;&#x5750;&#x6807;</li>
<li>@param w &#x5BBD;&#x5EA6;</li>
<li>@param h &#x9AD8;&#x5EA6;</li>
<li>@return AutoImage &#x5BF9;&#x8C61;&#x6216;&#x8005;null</li>
</ul>
<blockquote>
<pre><code class="lang-javascript">
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">main</span>(<span class="hljs-params"></span>) </span>{
    <span class="hljs-keyword">var</span> imageX = image.captureFullScreen();
    <span class="hljs-keyword">var</span> r = image.clip(imageX,<span class="hljs-number">100</span>,<span class="hljs-number">100</span>,<span class="hljs-number">300</span>,<span class="hljs-number">400</span>);
    toast(<span class="hljs-string">&quot;result &quot;</span>+r);
}
main();
</code></pre>
</blockquote>
<h2 id="imagepixel"><a name="imagepixel" class="anchor-navigation-ex-anchor" href="#imagepixel"><i class="fa fa-link" aria-hidden="true"></i></a>7.4. image.pixel</h2>
<ul>
<li>&#x53D6;&#x5F97;&#x56FE;&#x7247;&#x7684;&#x67D0;&#x4E2A;&#x70B9;&#x7684;&#x989C;&#x8272;&#x503C;</li>
<li>@param img &#x56FE;&#x7247;&#x5BF9;&#x8C61;</li>
<li>@param x x&#x5750;&#x6807;&#x70B9;</li>
<li>@param y y&#x5750;&#x6807;&#x70B9;</li>
<li>@return int &#x989C;&#x8272;&#x503C;</li>
</ul>
<blockquote>
<pre><code class="lang-javascript">
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">main</span>(<span class="hljs-params"></span>) </span>{
    <span class="hljs-keyword">var</span> imageX = image.captureFullScreen();
    <span class="hljs-keyword">var</span> r = image.pixel(imageX,<span class="hljs-number">100</span>,<span class="hljs-number">100</span>);
    toast(<span class="hljs-string">&quot;result &quot;</span>+r);
}
main();
</code></pre>
</blockquote>
<h2 id="imageisrecycled"><a name="imageisrecycled" class="anchor-navigation-ex-anchor" href="#imageisrecycled"><i class="fa fa-link" aria-hidden="true"></i></a>7.5. image.isRecycled</h2>
<ul>
<li>&#x662F;&#x5426;&#x88AB;&#x56DE;&#x6536;&#x4E86;</li>
<li>@param img &#x56FE;&#x7247;&#x5BF9;&#x8C61;</li>
<li>@return bool true&#x4EE3;&#x8868;&#x5DF2;&#x7ECF;&#x88AB;&#x56DE;&#x6536;&#x4E86;</li>
</ul>
<blockquote>
<pre><code class="lang-javascript">
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">main</span>(<span class="hljs-params"></span>) </span>{
    <span class="hljs-keyword">var</span> imageX = image.captureFullScreen();
    <span class="hljs-keyword">var</span> r = image.isRecycled(imageX);
    toast(<span class="hljs-string">&quot;result &quot;</span>+r);
}
main();
</code></pre>
</blockquote>
<h2 id="imagerecycle"><a name="imagerecycle" class="anchor-navigation-ex-anchor" href="#imagerecycle"><i class="fa fa-link" aria-hidden="true"></i></a>7.6. image.recycle</h2>
<ul>
<li>&#x56DE;&#x6536;&#x56FE;&#x7247;</li>
<li>@param img &#x56FE;&#x7247;&#x5BF9;&#x8C61;</li>
</ul>
<blockquote>
<pre><code class="lang-javascript">
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">main</span>(<span class="hljs-params"></span>) </span>{
    <span class="hljs-keyword">var</span> imageX = image.captureFullScreen();
     image.recycle(imageX);

}
main();
</code></pre>
</blockquote>

<script>console.log("plugin-popup....");document.onclick = function(e){ e.target.tagName === "IMG" && window.open(e.target.src,e.target.src)}</script><style>img{cursor:pointer}</style>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="event-api.html" class="navigation navigation-prev " aria-label="Previous page: 代理事件">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="device-api.html" class="navigation navigation-next " aria-label="Next page: 设备函数">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"图色函数","level":"1.7.6","depth":2,"next":{"title":"设备函数","level":"1.7.7","depth":2,"path":"zh-cn/funcs/device-api.md","ref":"zh-cn/funcs/device-api.md","articles":[]},"previous":{"title":"代理事件","level":"1.7.5","depth":2,"path":"zh-cn/funcs/event-api.md","ref":"zh-cn/funcs/event-api.md","articles":[]},"dir":"ltr"},"config":{"plugins":["chapter-fold","code","copy-code-button","-lunr","-search","search-pro","anchor-navigation-ex","hide-element","favicon-absolute","popup"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"chapter-fold":{},"search-pro":{},"popup":{},"code":{"copyButtons":true},"favicon-absolute":{"appleTouchIconMore":{},"appleTouchIconPrecomposed152":"/zh-cn/images/ico.png","appleTouchIconPrecomposedMore":{},"favicon":"/zh-cn/images/ico.png"},"hide-element":{"elements":[".gitbook-link"]},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"anchor-navigation-ex":{"associatedWithSummary":true,"float":{"floatIcon":"fa fa-navicon","level1Icon":"","level2Icon":"","level3Icon":"","showLevelIcon":false},"mode":"float","multipleH1":true,"pageTop":{"level1Icon":"","level2Icon":"","level3Icon":"","showLevelIcon":false},"printLog":false,"showGoTop":true,"showLevel":true},"copy-code-button":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"EasyClick开发文档","language":"zh-hans","gitbook":"*","description":"记录EasyClick开发教程和常用的函数"},"file":{"path":"zh-cn/funcs/image-api.md","mtime":"2020-05-25T02:55:04.833Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2020-06-23T14:38:08.296Z"},"basePath":"../..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../../gitbook/gitbook.js"></script>
    <script src="../../gitbook/theme.js"></script>
    
        
        <script src="../../gitbook/gitbook-plugin-chapter-fold/chapter-fold.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-code/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-copy-code-button/toggle.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search-pro/jquery.mark.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search-pro/search.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-hide-element/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

